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

--- Comment #9 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
(In reply to Wilco from comment #8)
> I don't think that comment is accurate.

Of course it isn't accurate *now*, but it explains why the code looks as it is.
I see the "phase-computing" code in expand_used_vars was added in 2004, but the
port is from 2001.

> The failure happens in cfgexpand
> before any RTL has been generated, so leaf_function_p must not be called
> this early. If starting_frame_offset doesn't remain constant things can go
> badly wrong.

Correct.

> The easiest fix is to always allocate an extra stack slot with exceptions
> and then avoid generating extra code in the prolog/epilog if it happens to
> be a leaf function.

Easiest perhaps, but far from right.  Don't worry about it.

It's just a pity leaf_function_p is so useless, but there are other ways.

Reply via email to