From: Aldy Hernandez Date: Wed, 9 Oct 2002 15:54:55 +0000 (+0000) Subject: rs6000.c (rs6000_ra_ever_killed): Call prologue_epilogue_contains instead of using... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=36f7e96410747bc76e93b6c9495610eec0766e9d;p=gcc.git rs6000.c (rs6000_ra_ever_killed): Call prologue_epilogue_contains instead of using REG_MAYBE_DEAD notes. 2002-10-08 Aldy Hernandez * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Call prologue_epilogue_contains instead of using REG_MAYBE_DEAD notes. From-SVN: r57985 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5df0457561d..33553cfafd9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-10-08 Aldy Hernandez + + * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Call + prologue_epilogue_contains instead of using REG_MAYBE_DEAD notes. + Wed Oct 9 15:54:49 2002 J"orn Rennecke * sh.md (ffssi2): Fix emitted code. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 53b7a9b5e3c..82892891609 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -9446,7 +9446,6 @@ function_ok_for_sibcall (fndecl) return 0; } -/* function rewritten to handle sibcalls */ static int rs6000_ra_ever_killed () { @@ -9458,19 +9457,21 @@ rs6000_ra_ever_killed () if (current_function_is_thunk) return 0; #endif - /* regs_ever_live has LR marked as used if any sibcalls - are present. Which it is, but this should not force - saving and restoring in the prologue/epilog. Likewise, - reg_set_between_p thinks a sibcall clobbers LR, so - that is inappropriate. */ + /* regs_ever_live has LR marked as used if any sibcalls are present, + but this should not force saving and restoring in the + pro/epilogue. Likewise, reg_set_between_p thinks a sibcall + clobbers LR, so that is inappropriate. */ + /* Also, the prologue can generate a store into LR that doesn't really count, like this: + move LR->R0 bcl to set PIC register move LR->R31 move R0->LR - When we're called from the epilog, we need to avoid counting - this as a store; thus we ignore any insns with a REG_MAYBE_DEAD note. */ + + When we're called from the epilogue, we need to avoid counting + this as a store. */ push_topmost_sequence (); top = get_insns (); @@ -9486,8 +9487,8 @@ rs6000_ra_ever_killed () else if (GET_CODE (insn) == CALL_INSN && !SIBLING_CALL_P (insn)) return 1; - else if (set_of (reg, insn) != NULL_RTX - && find_reg_note (insn, REG_MAYBE_DEAD, NULL_RTX) == 0) + else if (set_of (reg, insn) != NULL_RTX + && !prologue_epilogue_contains (insn)) return 1; } }