resource.c (mark_target_live_regs): Compute resources taking into account if a call...
authorClaudiu Zissulescu <claziss@synopsys.com>
Fri, 6 Sep 2013 17:27:54 +0000 (19:27 +0200)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Fri, 6 Sep 2013 17:27:54 +0000 (18:27 +0100)
2013-09-06 Claudiu Zissulescu <claziss@synopsys.com>

        * resource.c (mark_target_live_regs): Compute resources taking
        into account if a call is predicated or not.

From-SVN: r202343

gcc/ChangeLog
gcc/resource.c

index cbaf4c40f9920d2f7b0bd998709d40a2b23ae136..8493ee1424e99a7f120f3de991e552b484aea260 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-06 Claudiu Zissulescu <claziss@synopsys.com>
+
+       * resource.c (mark_target_live_regs): Compute resources taking
+       into account if a call is predicated or not.
+
 2013-09-06  Eric Botcazou  <ebotcazou@adacore.com>
 
        * toplev.c (output_stack_usage): Be prepared for suffixes created by
index a0fd2ec4e69b5cb17e8d9b88cfaaa2cd9be095ef..919cffbd0a09c9821a327cca6fc3fc959c8ebb83 100644 (file)
@@ -994,11 +994,18 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
 
          if (CALL_P (real_insn))
            {
-             /* CALL clobbers all call-used regs that aren't fixed except
-                sp, ap, and fp.  Do this before setting the result of the
-                call live.  */
-             AND_COMPL_HARD_REG_SET (current_live_regs,
-                                     regs_invalidated_by_call);
+             /* Values in call-clobbered registers survive a COND_EXEC CALL
+                if that is not executed; this matters for resoure use because
+                they may be used by a complementarily (or more strictly)
+                predicated instruction, or if the CALL is NORETURN.  */
+             if (GET_CODE (PATTERN (real_insn)) != COND_EXEC)
+               {
+                 /* CALL clobbers all call-used regs that aren't fixed except
+                    sp, ap, and fp.  Do this before setting the result of the
+                    call live.  */
+                 AND_COMPL_HARD_REG_SET (current_live_regs,
+                                         regs_invalidated_by_call);
+               }
 
              /* A CALL_INSN sets any global register live, since it may
                 have been modified by the call.  */