diff options
author | pfg <pfg@FreeBSD.org> | 2013-12-27 16:06:08 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-12-27 16:06:08 +0000 |
commit | 020ad1f282db55011d51031eb05015f0e3fb1161 (patch) | |
tree | 97d253bb94f5309a98dbf5dac4b79832c559f8ad | |
parent | 285471a802bf8879f872192d04afdc581490d121 (diff) | |
download | FreeBSD-src-020ad1f282db55011d51031eb05015f0e3fb1161.zip FreeBSD-src-020ad1f282db55011d51031eb05015f0e3fb1161.tar.gz |
gcc: Merge upstream changes.
Include types in error message for build_binary_op.
Mostly cosmetic changes, to reduce differences with Apple's gcc.
Obtained from: gcc 4.3 (rev. 120611, 124839, 125239; GPLv2)
-rw-r--r-- | contrib/gcc/ChangeLog.gcc43 | 24 | ||||
-rw-r--r-- | contrib/gcc/c-common.c | 7 | ||||
-rw-r--r-- | contrib/gcc/c-common.h | 2 | ||||
-rw-r--r-- | contrib/gcc/c-typeck.c | 6 | ||||
-rw-r--r-- | contrib/gcc/config/darwin.h | 4 | ||||
-rw-r--r-- | contrib/gcc/cp/ChangeLog.gcc43 | 8 | ||||
-rw-r--r-- | contrib/gcc/cp/Make-lang.in | 2 | ||||
-rw-r--r-- | contrib/gcc/cp/mangle.c | 2 | ||||
-rw-r--r-- | contrib/gcc/cp/rtti.c | 8 | ||||
-rw-r--r-- | contrib/gcc/cp/typeck.c | 2 | ||||
-rw-r--r-- | contrib/gcc/doc/tm.texi | 6 | ||||
-rw-r--r-- | contrib/gcc/dwarf2out.c | 11 | ||||
-rw-r--r-- | contrib/gcc/sched-vis.c | 5 | ||||
-rw-r--r-- | contrib/gcc/target-def.h | 5 | ||||
-rw-r--r-- | contrib/gcc/target.h | 4 | ||||
-rw-r--r-- | contrib/gcc/tree-dump.c | 2 |
16 files changed, 79 insertions, 19 deletions
diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43 index 5c6701a..8a1c1d0 100644 --- a/contrib/gcc/ChangeLog.gcc43 +++ b/contrib/gcc/ChangeLog.gcc43 @@ -57,6 +57,14 @@ operand. (store_expr): Handle BLKmode moves by calling emit_block_move. +2007-05-31 Daniel Berlin <dberlin@dberlin.org> (r125239) + + * c-typeck.c (build_indirect_ref): Include type in error message. + (build_binary_op): Pass types to binary_op_error. + * c-common.c (binary_op_error): Take two type arguments, print out + types with error. + * c-common.h (binary_op_error): Update prototype. + 2007-05-27 Eric Christopher <echristo@apple.com> (r125116) * config/rs6000/rs6000.c (rs6000_emit_prologue): Update @@ -80,6 +88,14 @@ regs_invalidated_by_call, rather than just checking the membership of REGNO (REG). +2007-05-18 Geoffrey Keating <geoffk@apple.com> (r124839) + + * dwarf2out.c (print_die): Use '%ld' not '%lu' to print a 'long'. + (output_die): Use 'unsigned long' with %x. + * sched-vis.c (print_value): Use 'unsigned HOST_WIDE_INT' and + HOST_WIDE_INT_PRINT_HEX to print HOST_WIDE_INT. + * tree-dump.c (dump_pointer): Use 'unsigned long' for %lx. + 2007-05-16 Eric Christopher <echristo@apple.com> (r124763) * config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register @@ -389,6 +405,14 @@ * config.gcc: Support core2 processor. +2007-01-08 Geoffrey Keating <geoffk@apple.com> (r120611) + + * target.h (struct gcc_target): New field library_rtti_comdat. + * target-def.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): New. + (TARGET_CXX): Add TARGET_CXX_LIBRARY_RTTI_COMDAT. + * doc/tm.texi (C++ ABI): Document TARGET_CXX_LIBRARY_RTTI_COMDAT. + * config/darwin.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): Define. + 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org> (r120505) PR c/19978 diff --git a/contrib/gcc/c-common.c b/contrib/gcc/c-common.c index fa89614..c2f0d4e 100644 --- a/contrib/gcc/c-common.c +++ b/contrib/gcc/c-common.c @@ -1988,10 +1988,10 @@ min_precision (tree value, int unsignedp) } /* Print an error message for invalid operands to arith operation - CODE. */ + CODE with TYPE0 for operand 0, and TYPE1 for operand 1. */ void -binary_op_error (enum tree_code code) +binary_op_error (enum tree_code code, tree type0, tree type1) { const char *opname; @@ -2042,7 +2042,8 @@ binary_op_error (enum tree_code code) default: gcc_unreachable (); } - error ("invalid operands to binary %s", opname); + error ("invalid operands to binary %s (have %qT and %qT)", opname, + type0, type1); } /* Subroutine of build_binary_op, used for comparison operations. diff --git a/contrib/gcc/c-common.h b/contrib/gcc/c-common.h index 453a2d6..00c58e3 100644 --- a/contrib/gcc/c-common.h +++ b/contrib/gcc/c-common.h @@ -650,7 +650,7 @@ extern tree c_sizeof_or_alignof_type (tree, bool, int); extern tree c_alignof_expr (tree); /* Print an error message for invalid operands to arith operation CODE. NOP_EXPR is used as a special case (see truthvalue_conversion). */ -extern void binary_op_error (enum tree_code); +extern void binary_op_error (enum tree_code, tree, tree); extern tree fix_string_type (tree); struct varray_head_tag; extern void constant_expression_warning (tree); diff --git a/contrib/gcc/c-typeck.c b/contrib/gcc/c-typeck.c index dd0fdc5..d19219f 100644 --- a/contrib/gcc/c-typeck.c +++ b/contrib/gcc/c-typeck.c @@ -1923,7 +1923,7 @@ build_indirect_ref (tree ptr, const char *errorstring) } } else if (TREE_CODE (pointer) != ERROR_MARK) - error ("invalid type argument of %qs", errorstring); + error ("invalid type argument of %qs (have %qT)", errorstring, type); return error_mark_node; } @@ -8135,7 +8135,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, || !same_scalar_type_ignoring_signedness (TREE_TYPE (type0), TREE_TYPE (type1)))) { - binary_op_error (code); + binary_op_error (code, type0, type1); return error_mark_node; } @@ -8431,7 +8431,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (!result_type) { - binary_op_error (code); + binary_op_error (code, TREE_TYPE (op0), TREE_TYPE (op1)); return error_mark_node; } diff --git a/contrib/gcc/config/darwin.h b/contrib/gcc/config/darwin.h index 9467bad..f4d4c7e 100644 --- a/contrib/gcc/config/darwin.h +++ b/contrib/gcc/config/darwin.h @@ -467,6 +467,10 @@ extern GTY(()) int darwin_ms_struct; with names, so it's safe to make the class data not comdat. */ #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_false +/* For efficiency, on Darwin the RTTI information that is always + emitted in the standard C++ library should not be COMDAT. */ +#define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_false + /* We make exception information linkonce. */ #undef TARGET_USES_WEAK_UNWIND_INFO #define TARGET_USES_WEAK_UNWIND_INFO 1 diff --git a/contrib/gcc/cp/ChangeLog.gcc43 b/contrib/gcc/cp/ChangeLog.gcc43 index 701bea8..f542192 100644 --- a/contrib/gcc/cp/ChangeLog.gcc43 +++ b/contrib/gcc/cp/ChangeLog.gcc43 @@ -18,6 +18,14 @@ * decl2.c (determine_visibility): Remove duplicate code for handling type info. +2007-05-31 Daniel Berlin <dberlin@dberlin.org> (r125239) + + * typeck.c (build_binary_op): Include types in error. + +2007-05-18 Geoffrey Keating <geoffk@apple.com> (r124839) + + * mangle.c (write_real_cst): Use 'unsigned long' for %lx. + 2007-05-05 Geoffrey Keating <geoffk@apple.com> (r124467) PR 31775 diff --git a/contrib/gcc/cp/Make-lang.in b/contrib/gcc/cp/Make-lang.in index ea03357..c863913 100644 --- a/contrib/gcc/cp/Make-lang.in +++ b/contrib/gcc/cp/Make-lang.in @@ -265,7 +265,7 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ $(TARGET_H) debug.h cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H) cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h convert.h \ - gt-cp-rtti.h + $(TARGET_H) gt-cp-rtti.h cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) except.h \ toplev.h cp/cfns.h $(EXPR_H) libfuncs.h $(TREE_INLINE_H) $(TARGET_H) cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \ diff --git a/contrib/gcc/cp/mangle.c b/contrib/gcc/cp/mangle.c index c327133..8bfdc20 100644 --- a/contrib/gcc/cp/mangle.c +++ b/contrib/gcc/cp/mangle.c @@ -1340,7 +1340,7 @@ write_real_cst (const tree value) for (; i != limit; i += dir) { - sprintf (buffer, "%08lx", target_real[i]); + sprintf (buffer, "%08lx", (unsigned long) target_real[i]); write_chars (buffer, 8); } } diff --git a/contrib/gcc/cp/rtti.c b/contrib/gcc/cp/rtti.c index 077d3e0..5e58e5c 100644 --- a/contrib/gcc/cp/rtti.c +++ b/contrib/gcc/cp/rtti.c @@ -32,6 +32,7 @@ Boston, MA 02110-1301, USA. */ #include "assert.h" #include "toplev.h" #include "convert.h" +#include "target.h" /* C++ returns type information to the user in struct type_info objects. We also use type information to implement dynamic_cast and @@ -1427,8 +1428,11 @@ emit_support_tinfos (void) comdat_linkage for details.) Since we want these objects to have external linkage so that copies do not have to be emitted in code outside the runtime library, we make them - non-COMDAT here. */ - if (!flag_weak) + non-COMDAT here. + + It might also not be necessary to follow this detail of the + ABI. */ + if (!flag_weak || ! targetm.cxx.library_rtti_comdat ()) { gcc_assert (TREE_PUBLIC (tinfo) && !DECL_COMDAT (tinfo)); DECL_INTERFACE_KNOWN (tinfo) = 1; diff --git a/contrib/gcc/cp/typeck.c b/contrib/gcc/cp/typeck.c index 5325989..1db89b49 100644 --- a/contrib/gcc/cp/typeck.c +++ b/contrib/gcc/cp/typeck.c @@ -3476,7 +3476,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, || !same_scalar_type_ignoring_signedness (TREE_TYPE (type0), TREE_TYPE (type1))) { - binary_op_error (code); + binary_op_error (code, type0, type1); return error_mark_node; } arithmetic_types_p = 1; diff --git a/contrib/gcc/doc/tm.texi b/contrib/gcc/doc/tm.texi index 0bc2784..8befbe5 100644 --- a/contrib/gcc/doc/tm.texi +++ b/contrib/gcc/doc/tm.texi @@ -8953,6 +8953,12 @@ classes whose virtual table will be emitted in only one translation unit will not be COMDAT. @end deftypefn +@deftypefn {Target Hook} bool TARGET_CXX_LIBRARY_RTTI_COMDAT (void) +This hook returns true (the default) if the RTTI information for +the basic types which is defined in the C++ runtime should always +be COMDAT, false if it should not be COMDAT. +@end deftypefn + @deftypefn {Target Hook} bool TARGET_CXX_USE_AEABI_ATEXIT (void) This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI) should be used to register static destructors when @option{-fuse-cxa-atexit} diff --git a/contrib/gcc/dwarf2out.c b/contrib/gcc/dwarf2out.c index 266973a..2a35206 100644 --- a/contrib/gcc/dwarf2out.c +++ b/contrib/gcc/dwarf2out.c @@ -5741,11 +5741,11 @@ print_die (dw_die_ref die, FILE *outfile) unsigned ix; print_spaces (outfile); - fprintf (outfile, "DIE %4lu: %s\n", + fprintf (outfile, "DIE %4ld: %s\n", die->die_offset, dwarf_tag_name (die->die_tag)); print_spaces (outfile); fprintf (outfile, " abbrev id: %lu", die->die_abbrev); - fprintf (outfile, " offset: %lu\n", die->die_offset); + fprintf (outfile, " offset: %ld\n", die->die_offset); for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++) { @@ -5793,7 +5793,7 @@ print_die (dw_die_ref die, FILE *outfile) if (AT_ref (a)->die_symbol) fprintf (outfile, "die -> label: %s", AT_ref (a)->die_symbol); else - fprintf (outfile, "die -> %lu", AT_ref (a)->die_offset); + fprintf (outfile, "die -> %ld", AT_ref (a)->die_offset); } else fprintf (outfile, "die -> <null>"); @@ -7063,7 +7063,8 @@ output_die (dw_die_ref die) output_die_symbol (die); dw2_asm_output_data_uleb128 (die->die_abbrev, "(DIE (0x%lx) %s)", - die->die_offset, dwarf_tag_name (die->die_tag)); + (unsigned long)die->die_offset, + dwarf_tag_name (die->die_tag)); for (ix = 0; VEC_iterate (dw_attr_node, die->die_attr, ix, a); ix++) { @@ -7245,7 +7246,7 @@ output_die (dw_die_ref die) /* Add null byte to terminate sibling list. */ if (die->die_child != NULL) dw2_asm_output_data (1, 0, "end of children of DIE 0x%lx", - die->die_offset); + (unsigned long) die->die_offset); } /* Output the compilation unit that appears at the beginning of the diff --git a/contrib/gcc/sched-vis.c b/contrib/gcc/sched-vis.c index 2012955..fec0bb7 100644 --- a/contrib/gcc/sched-vis.c +++ b/contrib/gcc/sched-vis.c @@ -430,7 +430,10 @@ print_value (char *buf, rtx x, int verbose) if (FLOAT_MODE_P (GET_MODE (x))) real_to_decimal (t, CONST_DOUBLE_REAL_VALUE (x), sizeof (t), 0, 1); else - sprintf (t, "<0x%lx,0x%lx>", (long) CONST_DOUBLE_LOW (x), (long) CONST_DOUBLE_HIGH (x)); + sprintf (t, + "<" HOST_WIDE_INT_PRINT_HEX "," HOST_WIDE_INT_PRINT_HEX ">", + (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x), + (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (x)); cur = safe_concat (buf, cur, t); break; case CONST_STRING: diff --git a/contrib/gcc/target-def.h b/contrib/gcc/target-def.h index 653d6fd..65b6079 100644 --- a/contrib/gcc/target-def.h +++ b/contrib/gcc/target-def.h @@ -587,6 +587,10 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT hook_bool_void_true #endif +#ifndef TARGET_CXX_LIBRARY_RTTI_COMDAT +#define TARGET_CXX_LIBRARY_RTTI_COMDAT hook_bool_void_true +#endif + #ifndef TARGET_CXX_USE_AEABI_ATEXIT #define TARGET_CXX_USE_AEABI_ATEXIT hook_bool_void_false #endif @@ -606,6 +610,7 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. TARGET_CXX_KEY_METHOD_MAY_BE_INLINE, \ TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY, \ TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT, \ + TARGET_CXX_LIBRARY_RTTI_COMDAT, \ TARGET_CXX_USE_AEABI_ATEXIT, \ TARGET_CXX_ADJUST_CLASS_AT_DEFINITION \ } diff --git a/contrib/gcc/target.h b/contrib/gcc/target.h index f407bb7..282871b 100644 --- a/contrib/gcc/target.h +++ b/contrib/gcc/target.h @@ -783,6 +783,10 @@ struct gcc_target class data for classes whose virtual table will be emitted in only one translation unit will not be COMDAT. */ bool (*class_data_always_comdat) (void); + /* Returns true (the default) if the RTTI for the basic types, + which is always defined in the C++ runtime, should be COMDAT; + false if it should not be COMDAT. */ + bool (*library_rtti_comdat) (void); /* Returns true if __aeabi_atexit should be used to register static destructors. */ bool (*use_aeabi_atexit) (void); diff --git a/contrib/gcc/tree-dump.c b/contrib/gcc/tree-dump.c index d97dc83..0924bb4 100644 --- a/contrib/gcc/tree-dump.c +++ b/contrib/gcc/tree-dump.c @@ -166,7 +166,7 @@ void dump_pointer (dump_info_p di, const char *field, void *ptr) { dump_maybe_newline (di); - fprintf (di->stream, "%-4s: %-8lx ", field, (long) ptr); + fprintf (di->stream, "%-4s: %-8lx ", field, (unsigned long) ptr); di->column += 15; } |