我如何告诉gcc我的内联程序集破坏了堆栈的一部分? [英] How do I tell gcc that my inline assembly clobbers part of the stack?

查看:73
本文介绍了我如何告诉gcc我的内联程序集破坏了堆栈的一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑像这样的内联汇编:

  uint64_t flags; 
asm(pushf\\\
\tpop%0:= rm(flags):: / * ??? * /);

尽管事实上可能有某种内在因素来获取RFLAGS的内容,但我如何向编译器指示我的内联程序集在栈顶压住了一个四字内存?

解决方案

据我所知,目前这是不可能的。


Consider inline assembly like this:

uint64_t flags;
asm ("pushf\n\tpop %0" : "=rm"(flags) : : /* ??? */);

Nonwithstanding the fact that there is probably some kind of intrinsic to get the contents of RFLAGS, how do I indicate to the compiler that my inline assembly clobbers one quadword of memory at the top of stack?

解决方案

As far as I am concerned, this is currently not possible.

这篇关于我如何告诉gcc我的内联程序集破坏了堆栈的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆