This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/82926] x86_64 inline assembly with push/pop produces buggy code
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Nov 2017 23:01:41 +0000
- Subject: [Bug target/82926] x86_64 inline assembly with push/pop produces buggy code
- Auto-submitted: auto-generated
- References: <bug-82926-4@http.gcc.gnu.org/bugzilla/>
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.