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 target/82926] x86_64 inline assembly with push/pop produces buggy code


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If it is __x86_64__ only, then the push/pop is totally useless, %rbx is like
any other reg (for __i386__ too if not pic or when using a recent gcc).
So just asm ("cpuid" : "=a" (*a), "=b" (*b), "=c" (*c), "=d" (*d) : "0" (op));
Or you could e.g. xchg %%ebx, %%esi and back for __i386__ instead of the
push/pop, or, if for whatever weird reason you don't want to clobber %rbx for
__x86_64__, you could e.g. subtract the red zone size from %rsp first, then
push and after poping add back.

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