Martin, > I suppose that could be done by something like the following, which I > have tested only very mildly so far, in particular I have not double > checked that get_inner_reference is cfun-agnostic.
The patch introduces no regressions on x86-64/Linux and makes the testcase (gnat.dg/specs/pack12.ads attached to the first message) pass. Do you plan to install it (along with the testcase)? > 2014-12-03 Martin Jambor <mjam...@suse.cz> > > * tree-sra.c (ipa_sra_check_caller_data): New type. > (has_caller_p): Removed. > (ipa_sra_check_caller): New function. > (ipa_sra_preliminary_function_checks): Use it. -- Eric Botcazou