This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug inline-asm/80470] Can't compile wait4 implementation on i586 target


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");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]