aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2011-06-04 10:08:09 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2011-06-04 10:08:09 +0000
commit047d33a0d40c52a5b227766c9af65d695d10b190 (patch)
treec32f943e34979d31a3ae1aa747c6a3dc76e55dd4
parent57ee85b4394430954a5b2704dbf9d1852cd571fb (diff)
downloadgcc-047d33a0d40c52a5b227766c9af65d695d10b190.zip
gcc-047d33a0d40c52a5b227766c9af65d695d10b190.tar.gz
gcc-047d33a0d40c52a5b227766c9af65d695d10b190.tar.bz2
re PR debug/48333 (-fcompare-debug failure (length) - "memmove" x "__builtin_memmove")
PR debug/48333 * calls.c (emit_call_1): Prefer the __builtin declaration of builtin functions. From-SVN: r174636
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/calls.c15
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cdb14e9..c7f031f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-04 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/48333
+ * calls.c (emit_call_1): Prefer the __builtin declaration of
+ builtin functions.
+
2011-06-03 Diego Novillo <dnovillo@google.com>
* lto-streamer-in.c (unpack_value_fields): Remove unneeded asserts.
diff --git a/gcc/calls.c b/gcc/calls.c
index 512ff0e..f5592c5 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -272,7 +272,20 @@ emit_call_1 (rtx funexp, tree fntree ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNU
funmem = gen_rtx_MEM (FUNCTION_MODE, funexp);
if (fndecl && TREE_CODE (fndecl) == FUNCTION_DECL)
- set_mem_expr (funmem, fndecl);
+ {
+ tree t = fndecl;
+ /* Although a built-in FUNCTION_DECL and its non-__builtin
+ counterpart compare equal and get a shared mem_attrs, they
+ produce different dump output in compare-debug compilations,
+ if an entry gets garbage collected in one compilation, then
+ adds a different (but equivalent) entry, while the other
+ doesn't run the garbage collector at the same spot and then
+ shares the mem_attr with the equivalent entry. */
+ if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL
+ && built_in_decls[DECL_FUNCTION_CODE (t)])
+ t = built_in_decls[DECL_FUNCTION_CODE (t)];
+ set_mem_expr (funmem, t);
+ }
else if (fntree)
set_mem_expr (funmem, build_simple_mem_ref (CALL_EXPR_FN (fntree)));