diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b53b5551cf..dd1a961dcaa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-04-10 Ulrich Weigand + + * reload1.c (choose_reload_regs): HARD_FRAME_POINTER_REGNUM + is only used as frame pointer when frame_pointer_needed is true. + 2002-04-10 Richard Earnshaw PR target/817 diff --git a/gcc/reload1.c b/gcc/reload1.c index c36799f4381..cf807af01e1 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -5565,6 +5565,7 @@ choose_reload_regs (chain) && ! TEST_HARD_REG_BIT (reg_reloaded_dead, i)) /* Don't clobber the frame pointer. */ || (i == HARD_FRAME_POINTER_REGNUM + && frame_pointer_needed && rld[r].out) /* Don't really use the inherited spill reg if we need it wider than we've got it. */ @@ -5735,7 +5736,9 @@ choose_reload_regs (chain) /* If we found an equivalent reg, say no code need be generated to load it, and use it as our reload reg. */ - if (equiv != 0 && regno != HARD_FRAME_POINTER_REGNUM) + if (equiv != 0 + && (regno != HARD_FRAME_POINTER_REGNUM + || !frame_pointer_needed)) { int nr = HARD_REGNO_NREGS (regno, rld[r].mode); int k;