https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122798
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
On x86 with -m32, there are various ABIs, normal, regparm(1), regparm(2),
regparm(3), sseregparm, fastcall, thiscall etc.
See config/i386/i386.cc (ix86_function_regparm) where it in some cases picks a
different ABI for local functions if it can arrange for all the callers to be
changed.
That isn't the case for the OpenMP/OpenACC functions though, and generally not
for other callbacks either unless all the indirect calls can be adjusted as
well.
Guess before your changes cgraph was seeing a static function having its
address escape to a non-local function, so most likely target->local wasn't
set:
/* Set when function is visible in current compilation unit only and
its address is never taken. */
unsigned local : 1;
Now, if the cgraph optimizations of the gnu_callback attribute cause
node->local not to be set because while the address escapes, we have a
guarantee that it will be only called through, then either we should arrange
for node->cannot_change_signature to be set (although, frangly the
optimizations actually could change the signature if they
can change one struct XYZ * argument to struct YZW * with different layout (or
do they
just keep the same struct and just omit some loads or stores)?). Or add a new
flag, so that we at least don't try to change ABI of such functions.