https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118939

--- Comment #19 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to Eric Botcazou from comment #18)
> > So the real question is why has the size of the frame changed once it's too
> > late to change the frame layout?
> 
> The frame size has not changed, rather the value returned by get_frame_size
> has because of the way it is implemented:

If the value returned is different from earlier, then it has changed.  Using
different methods for calculating the size during different passes would a
recipe for endless bugs, especially if crufted into the back-ends.

> But the more fundamental problem is that, if <target>_frame_pointer_required
> does not return the same answer at the beginning of IRA and during LRA, then
> LRA will materialize the frame pointer very late in the game, after the
> frame is laid out, and I guess that most targets will break like in the case
> at hand.

The mid-end code has to cope with that.  There may be circumstances where we
initially think the frame-pointer can be eliminated, but later find we can't. 
It won't flip-flop randomly, but it might have to change based on additional
knowledge that is aquired as the frame layout process is done.

Reply via email to