From c42091c1b505de009cea3420537a5453d81d0165 Mon Sep 17 00:00:00 2001 From: Claudiu Zissulescu Date: Fri, 6 Sep 2013 19:27:54 +0200 Subject: [PATCH] resource.c (mark_target_live_regs): Compute resources taking into account if a call is predicated or not. 2013-09-06 Claudiu Zissulescu * resource.c (mark_target_live_regs): Compute resources taking into account if a call is predicated or not. From-SVN: r202343 --- gcc/ChangeLog | 5 +++++ gcc/resource.c | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cbaf4c40f99..8493ee1424e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-09-06 Claudiu Zissulescu + + * resource.c (mark_target_live_regs): Compute resources taking + into account if a call is predicated or not. + 2013-09-06 Eric Botcazou * toplev.c (output_stack_usage): Be prepared for suffixes created by diff --git a/gcc/resource.c b/gcc/resource.c index a0fd2ec4e69..919cffbd0a0 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. */ -- 2.30.2