svn commit: r259947 - in stable/10/contrib/gcc: . config cp doc
Pedro F. Giffuni
pfg at FreeBSD.org
Fri Dec 27 16:06:12 UTC 2013
Author: pfg
Date: Fri Dec 27 16:06:08 2013
New Revision: 259947
URL: http://svnweb.freebsd.org/changeset/base/259947
Log:
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)
Modified:
stable/10/contrib/gcc/ChangeLog.gcc43
stable/10/contrib/gcc/c-common.c
stable/10/contrib/gcc/c-common.h
stable/10/contrib/gcc/c-typeck.c
stable/10/contrib/gcc/config/darwin.h
stable/10/contrib/gcc/cp/ChangeLog.gcc43
stable/10/contrib/gcc/cp/Make-lang.in
stable/10/contrib/gcc/cp/mangle.c
stable/10/contrib/gcc/cp/rtti.c
stable/10/contrib/gcc/cp/typeck.c
stable/10/contrib/gcc/doc/tm.texi
stable/10/contrib/gcc/dwarf2out.c
stable/10/contrib/gcc/sched-vis.c
stable/10/contrib/gcc/target-def.h
stable/10/contrib/gcc/target.h
stable/10/contrib/gcc/tree-dump.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/contrib/gcc/ChangeLog.gcc43
==============================================================================
--- stable/10/contrib/gcc/ChangeLog.gcc43 Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/ChangeLog.gcc43 Fri Dec 27 16:06:08 2013 (r259947)
@@ -57,6 +57,14 @@
operand.
(store_expr): Handle BLKmode moves by calling emit_block_move.
+2007-05-31 Daniel Berlin <dberlin at 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 at 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 at 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 at 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 at 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 at gcc.gnu.org> (r120505)
PR c/19978
Modified: stable/10/contrib/gcc/c-common.c
==============================================================================
--- stable/10/contrib/gcc/c-common.c Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/c-common.c Fri Dec 27 16:06:08 2013 (r259947)
@@ -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.
Modified: stable/10/contrib/gcc/c-common.h
==============================================================================
--- stable/10/contrib/gcc/c-common.h Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/c-common.h Fri Dec 27 16:06:08 2013 (r259947)
@@ -650,7 +650,7 @@ extern tree c_sizeof_or_alignof_type (tr
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);
Modified: stable/10/contrib/gcc/c-typeck.c
==============================================================================
--- stable/10/contrib/gcc/c-typeck.c Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/c-typeck.c Fri Dec 27 16:06:08 2013 (r259947)
@@ -1923,7 +1923,7 @@ build_indirect_ref (tree ptr, const char
}
}
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, tr
|| !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, tr
if (!result_type)
{
- binary_op_error (code);
+ binary_op_error (code, TREE_TYPE (op0), TREE_TYPE (op1));
return error_mark_node;
}
Modified: stable/10/contrib/gcc/config/darwin.h
==============================================================================
--- stable/10/contrib/gcc/config/darwin.h Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/config/darwin.h Fri Dec 27 16:06:08 2013 (r259947)
@@ -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
Modified: stable/10/contrib/gcc/cp/ChangeLog.gcc43
==============================================================================
--- stable/10/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/cp/ChangeLog.gcc43 Fri Dec 27 16:06:08 2013 (r259947)
@@ -18,6 +18,14 @@
* decl2.c (determine_visibility): Remove duplicate code for
handling type info.
+2007-05-31 Daniel Berlin <dberlin at dberlin.org> (r125239)
+
+ * typeck.c (build_binary_op): Include types in error.
+
+2007-05-18 Geoffrey Keating <geoffk at apple.com> (r124839)
+
+ * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
+
2007-05-05 Geoffrey Keating <geoffk at apple.com> (r124467)
PR 31775
Modified: stable/10/contrib/gcc/cp/Make-lang.in
==============================================================================
--- stable/10/contrib/gcc/cp/Make-lang.in Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/cp/Make-lang.in Fri Dec 27 16:06:08 2013 (r259947)
@@ -265,7 +265,7 @@ cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_
$(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) \
Modified: stable/10/contrib/gcc/cp/mangle.c
==============================================================================
--- stable/10/contrib/gcc/cp/mangle.c Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/cp/mangle.c Fri Dec 27 16:06:08 2013 (r259947)
@@ -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);
}
}
Modified: stable/10/contrib/gcc/cp/rtti.c
==============================================================================
--- stable/10/contrib/gcc/cp/rtti.c Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/cp/rtti.c Fri Dec 27 16:06:08 2013 (r259947)
@@ -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;
Modified: stable/10/contrib/gcc/cp/typeck.c
==============================================================================
--- stable/10/contrib/gcc/cp/typeck.c Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/cp/typeck.c Fri Dec 27 16:06:08 2013 (r259947)
@@ -3476,7 +3476,7 @@ build_binary_op (enum tree_code code, tr
|| !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;
Modified: stable/10/contrib/gcc/doc/tm.texi
==============================================================================
--- stable/10/contrib/gcc/doc/tm.texi Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/doc/tm.texi Fri Dec 27 16:06:08 2013 (r259947)
@@ -8953,6 +8953,12 @@ classes whose virtual table will be emit
unit will not be COMDAT.
@end deftypefn
+ at 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.
+ at 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}
Modified: stable/10/contrib/gcc/dwarf2out.c
==============================================================================
--- stable/10/contrib/gcc/dwarf2out.c Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/dwarf2out.c Fri Dec 27 16:06:08 2013 (r259947)
@@ -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
Modified: stable/10/contrib/gcc/sched-vis.c
==============================================================================
--- stable/10/contrib/gcc/sched-vis.c Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/sched-vis.c Fri Dec 27 16:06:08 2013 (r259947)
@@ -430,7 +430,10 @@ print_value (char *buf, rtx x, int verbo
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:
Modified: stable/10/contrib/gcc/target-def.h
==============================================================================
--- stable/10/contrib/gcc/target-def.h Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/target-def.h Fri Dec 27 16:06:08 2013 (r259947)
@@ -587,6 +587,10 @@ Foundation, 51 Franklin Street, Fifth Fl
#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 Fl
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 \
}
Modified: stable/10/contrib/gcc/target.h
==============================================================================
--- stable/10/contrib/gcc/target.h Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/target.h Fri Dec 27 16:06:08 2013 (r259947)
@@ -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);
Modified: stable/10/contrib/gcc/tree-dump.c
==============================================================================
--- stable/10/contrib/gcc/tree-dump.c Fri Dec 27 15:52:18 2013 (r259946)
+++ stable/10/contrib/gcc/tree-dump.c Fri Dec 27 16:06:08 2013 (r259947)
@@ -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;
}
More information about the svn-src-stable-10
mailing list