[Bug inline-asm/80470] Can't compile wait4 implementation on i586 target
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Apr 20 08:50:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80470
--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Martin Liška from comment #3)
> (In reply to Uroš Bizjak from comment #2)
> > You should not clobber esp.
>
> Works for me, thanks. Can you please explain me why it makes problem? Is it
> because not enough registers or?
Register allocator can't omit frame pointer (%ebp) to stack pointer (%esp) when
the latter is clobbered in the asm.
BTW, gcc7 allows you to use %ebx directly through "b" constraint, so:
__asm__ __volatile__("int $0x80"
: "=a"(__res)
: "0"(114), "b"((long)(p)), "c"((long)(s)),
"d"((long)(o)), "S"((long)(r))
: "memory");
More information about the Gcc-bugs
mailing list