emit-rtl.c (active_insn_p): Consider a clobber of the function return value to be...
authorRichard Henderson <rth@redhat.com>
Fri, 27 Sep 2002 00:28:20 +0000 (17:28 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 27 Sep 2002 00:28:20 +0000 (17:28 -0700)
        * emit-rtl.c (active_insn_p): Consider a clobber of the
        function return value to be active even after reload.

From-SVN: r57561

gcc/ChangeLog
gcc/emit-rtl.c

index 2458c15c5ae1ae28ef20af0406fd51703b6d4d51..5638d5db78375903be9277f4084fac22964f4e72 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-26  Richard Henderson  <rth@redhat.com>
+
+       * emit-rtl.c (active_insn_p): Consider a clobber of the
+       function return value to be active even after reload.
+
 2002-09-27  Alan Modra  <amodra@bigpond.net.au>
 
        * doloop.c (doloop_modify_runtime <biv skips initial incr>): Adjust
index a5a776041aa4b0a72828ed37c110b6331362a0ef..ccd6cbad0aa74ae93d65bad4144a63e5f1210b86 100644 (file)
@@ -3022,11 +3022,34 @@ int
 active_insn_p (insn)
      rtx insn;
 {
-  return (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN
-         || (GET_CODE (insn) == INSN
-             && (! reload_completed
-                 || (GET_CODE (PATTERN (insn)) != USE
-                     && GET_CODE (PATTERN (insn)) != CLOBBER))));
+  if (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN)
+    return true;
+  if (GET_CODE (insn) == INSN)
+    {
+      if (reload_completed)
+       {
+         rtx pat = PATTERN (insn);
+
+         /* After reload, remaining USE insns are noops.  */
+         if (GET_CODE (pat) == USE)
+           return false;
+
+         if (GET_CODE (pat) == CLOBBER)
+           {
+             /* ??? Don't skip past the clobber of the return register.
+                If we eliminate it, we risk a variety of life analysis
+                problems on broken code.  */
+             if (GET_CODE (XEXP (pat, 0)) == REG
+                 && REG_FUNCTION_VALUE_P (XEXP (pat, 0)))
+               return true;
+
+             /* Otherwise, clobbers don't do anything either.  */
+             return false;
+           }
+       }
+      return true;
+    }
+  return false;
 }
 
 rtx