I don't think this is valid. You cannot depend on where the spill will
happen around a function call. It is spilling to save the volatile
register. With -O, we don't use volatile registers to keep variables
across functions. While at -O2 we do so it saves it right before the
function call.
On Linux/x86-64, IRA/reload moves asm statement by
adding "movss" at -O2:
[...@gnu-6 vzeroupper-1]$ cat foo.c
extern void bar2 (void);
float
foo (float y)
{
asm volatile ("nop");
bar2 ();
return y;
}
[...@gnu-6 vzeroupper-1]$ gcc -S -O foo.c
[...@gnu-6 vzeroupper-1]$ cat foo.s
.file