aboutsummaryrefslogtreecommitdiff
path: root/gcc/resource.c
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2013-09-06 19:27:54 +0200
committerJoern Rennecke <amylaar@gcc.gnu.org>2013-09-06 18:27:54 +0100
commitc42091c1b505de009cea3420537a5453d81d0165 (patch)
treee9d3367377ae74b0cd5bae6deee44fccdc09158d /gcc/resource.c
parent2c641f8b3a3059353ac6f8798d10d2f5c611109b (diff)
downloadgcc-c42091c1b505de009cea3420537a5453d81d0165.zip
gcc-c42091c1b505de009cea3420537a5453d81d0165.tar.gz
gcc-c42091c1b505de009cea3420537a5453d81d0165.tar.bz2
resource.c (mark_target_live_regs): Compute resources taking into account if a call is predicated or not.
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
Diffstat (limited to 'gcc/resource.c')
-rw-r--r--gcc/resource.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/resource.c b/gcc/resource.c
index a0fd2ec..919cffb 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -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. */