[Bug c++/70594] [6 Regression] -fcompare-debug failure

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 12 10:13:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #23 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
2016-04-12  Jakub Jelinek  <jakub@redhat.com>

        PR c++/70594
        * tree-sra.c (make_fancy_decl_name): Don't add DECL_UID
        into the fancy names if -fdump-final-insns=.

--- gcc/tree-sra.c.jj   2016-04-12 11:08:10.000000000 +0200
+++ gcc/tree-sra.c      2016-04-12 11:15:35.519676357 +0200
@@ -1543,6 +1543,9 @@ make_fancy_decl_name (tree decl)
   if (name)
     obstack_grow (&name_obstack, IDENTIFIER_POINTER (name),
                  IDENTIFIER_LENGTH (name));
+  /* Avoid -fcompare-debug issues on DECL_UID differences.  */
+  else if (flag_dump_final_insns != NULL)
+    obstack_grow (&name_obstack, "Dxxxx", 5);
   else
     {
       sprintf (buffer, "D%u", DECL_UID (decl));

is something we should do in any case, because the DECL_IGNORED names can make
it into the -fdump-final-insns= dump and the TDF_NOUID in that case can't help
with that.


More information about the Gcc-bugs mailing list