[Bug c/104805] [12.0] x86_64 Extended asm may use rbp register to input/output even thougth "rbp" is in the clobber list when "rsp" and "rbp" are both in the in the clobber list

570070308 at qq dot com gcc-bugzilla@gcc.gnu.org
Sun Mar 6 11:51:46 GMT 2022


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

--- Comment #2 from 。 <570070308 at qq dot com> ---
(In reply to Jakub Jelinek from comment #1)
> Clobber of "rsp" makes no sense, you can't change the value of the stack
> pointer in inline asm without restoring it back before the end of inline asm.

I know that changing rsp is dangerous, and the gcc will give a warning if you
use rsp. I have never changed rsp in my inline-asm coding, or put "rsp" in the
clobber list. I'm just for finding bug and make gcc better.

what about:

__asm__
(
"pushq %%rax\n\t"
"popq %%rax"
:
:
:"rsp"
);


More information about the Gcc-bugs mailing list