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

--- Comment #13 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #12)
> > Having said that, I am not sure where to best fix this so late in the
> > GCC 10 development cycle.
> 
> So the problem is that thunk is expanded on the adjusted decl but we
> still keep the adjustments and later fail to apply them?
> 
> I guess we have two options:
>  1) force thunk expansion to happen on original decls (before cloning)
>     so the body ends up being same as for ordinary function

I was thinking about this too.  I will try to look into expand_thunk
whether I can leave the call statement mostly alone (apart from the
thunk transform itself, of course).

>  2) remove the adjustments after expansion - this should IMO work
>     under the assumption that optimization passes don't insert
>     non-trivial code into the thunk before they expand the thunk (i.e.
>     if you want to adjust it in ipa-sra you will want to first produce
>     the thunk and then do adjustement)
> It seems to me that 2 should be not that hard to implement
> Does that make sense?

Unfortunately I don't think so.  The adjustment is attached to the
callee (just like in the past the skip_args bitmap was - and we're
only skipping arguments in the testcase), so you cannot just remove it
in one caller.  Or am I missing something?

Reply via email to