]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
flow.c (propagate_one_insn): When removing an insn with a REG_LIBCALL note but not...
authorJeff Law <law@redhat.com>
Mon, 24 Jun 2002 20:20:52 +0000 (14:20 -0600)
committerJeff Law <law@gcc.gnu.org>
Mon, 24 Jun 2002 20:20:52 +0000 (14:20 -0600)
        * flow.c (propagate_one_insn): When removing an insn
        with a REG_LIBCALL note but not the entire libcall sequence,
        delete the associated REG_RETVAL note.

From-SVN: r54966

gcc/ChangeLog
gcc/flow.c

index c7bd7c789493c80ef90c56d4f4fd6d229915e3e6..45a686c03c7839df2dd5debcb7c20a603c165217 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-24  Jeff Law <law@redhat.com>
+
+       * flow.c (propagate_one_insn): When removing an insn
+       with a REG_LIBCALL note but not the entire libcall sequence,
+       delete the associated REG_RETVAL note.
+
 Mon Jun 24 21:05:09 2002  J"orn Rennecke <joern.rennecke@superh.com>
 
        * lib1funcs.asm (sdivsi3): Add optimized SH64 implementations.
index 48016cef781a911071bf4acfb0db91cd883ad6fd..aad646af0f65a8ba9d3b29be8920ad9e9eff363f 100644 (file)
@@ -1650,22 +1650,38 @@ propagate_one_insn (pbi, insn)
       else
        {
 
+       /* If INSN contains a RETVAL note and is dead, but the libcall
+          as a whole is not dead, then we want to remove INSN, but
+          not the whole libcall sequence.
+
+          However, we need to also remove the dangling REG_LIBCALL     
+          note so that we do not have mis-matched LIBCALL/RETVAL
+          notes.  In theory we could find a new location for the
+          REG_RETVAL note, but it hardly seems worth the effort. 
+
+          NOTE at this point will be the RETVAL note if it exists.  */
          if (note)
            {
-             /* If INSN contains a RETVAL note and is dead, but the libcall
-                as a whole is not dead, then we want to remove INSN, but
-                not the whole libcall sequence.
-
-                However, we need to also remove the dangling REG_LIBCALL       
-                note so that we do not have mis-matched LIBCALL/RETVAL
-                notes.  In theory we could find a new location for the
-                REG_RETVAL note, but it hardly seems worth the effort.  */
              rtx libcall_note;
         
              libcall_note
                = find_reg_note (XEXP (note, 0), REG_LIBCALL, NULL_RTX);
              remove_note (XEXP (note, 0), libcall_note);
            }
+
+         /* Similarly if INSN contains a LIBCALL note, remove the
+            dnagling REG_RETVAL note.  */
+         note = find_reg_note (insn, REG_LIBCALL, NULL_RTX);
+         if (note)
+           {
+             rtx retval_note;
+
+             retval_note
+               = find_reg_note (XEXP (note, 0), REG_RETVAL, NULL_RTX);
+             remove_note (XEXP (note, 0), retval_note);
+           }
+
+         /* Now delete INSN.  */
          propagate_block_delete_insn (insn);
        }