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/67944] GCC emits unnecessary push/pop for callee-save reads.


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

--- Comment #2 from Alex Reinking <alex.reinking at gmail dot com> ---
I expect it to return whatever is currently stored in ebx. Which it does, but
suboptimally. In my particular case, ebx is populated by a system call. I
wanted to put the inline assembly for retrieving that value in its own function
so I wouldn't have to remember the local register variable syntax.

The code I posted is simply a somehow minimal example of the anomalous assembly
generated. The question here is more "Why does gcc emit a push ebx; pop ebx?"
than "How should I retrieve whatever is currently in ebx?"


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