[Bug ipa/64963] IPA Cloning/Splitting does not copy function section attributes resulting in kernel miscompilation

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 10 13:17:00 GMT 2015


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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think cloning into the same section make as much sense as not doing it.  That
is, I see valid uses for both behaviors.

We've been cloning not to the same section since quite a few releases so
changing
that would be surprising.

But apart from disabling cloning with noclone we don't have a way to tell the
compiler to put clones into the same section as the parents.

I can also think of heuristics like if there is a caller of the clone from
the same section as the clone origin then putting the clone into the very
same section makes sense.

We could invent a new flag like -fsticky-section=XXXX and/or a similar
attribute
or flag on the section attribute (__attribute__((section("foo",sticky)))).



More information about the Gcc-bugs mailing list