From: Claudiu Zissulescu Date: Fri, 6 Sep 2013 17:27:54 +0000 (+0200) Subject: resource.c (mark_target_live_regs): Compute resources taking into account if a call... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c42091c1b505de009cea3420537a5453d81d0165;p=gcc.git 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 --- 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. */