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

--- Comment #18 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> 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:

/* Return size needed for stack frame based on slots so far allocated.
   This size counts from zero.  It is not rounded to PREFERRED_STACK_BOUNDARY;
   the caller may have to do that.  */

poly_int64
get_frame_size (void)
{
  if (FRAME_GROWS_DOWNWARD)
    return -frame_offset;
  else
    return frame_offset;
}

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.

Reply via email to