GSoC: possible IPA-ICF project direction
Richard Biener
rguenther@suse.de
Tue Sep 15 07:54:55 GMT 2026
On Tue, 15 Sep 2026, Rohith Kapelli wrote:
> Hi Richard,
>
> I looked into the separate-body idea using reduced testcases for
> PR119006 and PR123227, using trunk from 3 September, before the PR119006
> and PR123227 fixes.
>
> For PR119006, the current merge is safe when the leader's out-of-line
> body is not inlined, but inlining the leader into the other caller
> produces the wrong code. Defining the two structs in the opposite order
> swaps the leader and makes the failure disappear. I also emulated your
> model by making both functions always_inline, putting them in an
> anonymous namespace so the originals get inlined into their own callers
> while ICF still merges the out-of-line copies. That exits 0.
>
> PR123227 looks different: the leader's out-of-line body itself depends
> on a nonnull this promise that only the leader makes. The emitted leader
> has no null check, while the inlined copy retains it, so out-of-line
> callers still reach the problematic body. I haven't implemented the
> separate-body scheme, so this is only what the testcase shows.
Yes, that's what I expected - the separate body case only allows some
cases of mismatches to prevail. Implementing separate bodies on
the cgraph level, one body for inlining, one for offline code generation,
is another thing that might qualify for a GSoC project. Honza or Martin
would be to sign-off on that though, as they are the most natural mentors
for this.
Richard.
> I also checked the GNU extern inline point. With both definitions in one
> file, the gnu_inline body is dropped and even the direct call uses the
> out-of-line definition; with separate files, the direct call inlines the
> gnu_inline body while the pointer call uses the out-of-line one.
>
> I don't have a clean test of the IPA-clone part yet. I'll look next at
> how ICF currently handles the losing bodies, and whether the
> separate-body idea from the extern inline discussion could apply.
>
> Thanks,
> Rohith
>
--
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri; (HRB 36809, AG Nuernberg)
More information about the Gcc
mailing list