dce.c (delete_unmarked_insns): Just delete the RETVAL and LIBCALL notes if...
authorAndreas Krebbel <krebbel1@de.ibm.com>
Sun, 28 Oct 2007 10:14:21 +0000 (10:14 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Sun, 28 Oct 2007 10:14:21 +0000 (10:14 +0000)
2007-10-28  Andreas Krebbel  <krebbel1@de.ibm.com>

* dce.c (delete_unmarked_insns): Just delete the RETVAL and
LIBCALL notes if they are about to be moved to the same insn.

From-SVN: r129693

gcc/ChangeLog
gcc/dce.c

index 78bb02d48f64e71c904dd681899543c5a5ff6c2e..ef136a53d876bfae40209d0e3db9bb914a70a361 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-28  Andreas Krebbel  <krebbel1@de.ibm.com>
+
+       * dce.c (delete_unmarked_insns): Just delete the RETVAL and
+       LIBCALL notes if they are about to be moved to the same insn.
+
 2007-10-27  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/33870
index bf8e7a3bc0eb3c39605d49d35a6dd9876e9380d2..e63a07a9ef4213f71c170b73f53a7f29a5929ef3 100644 (file)
--- a/gcc/dce.c
+++ b/gcc/dce.c
@@ -346,10 +346,17 @@ delete_unmarked_insns (void)
              rtx new_libcall_insn = next_real_insn (insn);
              rtx retval_note = find_reg_note (XEXP (note, 0),
                                               REG_RETVAL, NULL_RTX);
-             REG_NOTES (new_libcall_insn)
-               = gen_rtx_INSN_LIST (REG_LIBCALL, XEXP (note, 0),
-                                    REG_NOTES (new_libcall_insn));
-             XEXP (retval_note, 0) = new_libcall_insn;
+             /* If the RETVAL and LIBCALL notes would land on the same
+                insn just remove them.  */
+             if (XEXP (note, 0) == new_libcall_insn)
+               remove_note (new_libcall_insn, retval_note);
+             else
+               {
+                 REG_NOTES (new_libcall_insn)
+                   = gen_rtx_INSN_LIST (REG_LIBCALL, XEXP (note, 0),
+                                        REG_NOTES (new_libcall_insn));
+                 XEXP (retval_note, 0) = new_libcall_insn;
+               }
            }
 
          /* If the insn contains a REG_RETVAL note and is dead, but the