> > + tree a; > > + > > + if (in_lto_p) > > + cgraph_get_body (node); > > That looks gross. It cannot possibly be the correct fix for this. DECL_ARGUMENTS/DECL_RESULT are now part of function body. cgraph_get_body is there to load it for you when you need it. We are going to expand the function so it makes sense to get it.
The same is done by the passmanager when function is going to be expanded. Only difference here is that thunks do not go through the passmanager. I can drop in_lto_p (the function does nothing when body is already there) Honza