[LLVMdev] clang modifying clobbered register in case of inline assembly resulting in data corruption
Eli Friedman
eli.friedman at gmail.com
Thu Nov 29 01:07:17 PST 2012
On Wed, Nov 28, 2012 at 11:49 PM, Karthik Bhat <karthikthecool at gmail.com> wrote:
> In this case the value of data[0] has got corrupted as clang is not
> honoring clobbered register and stores a different value in $eax.
Not a bug; that isn't how clobbers work. We don't make any guarantees
about the values of registers between inline asm statements. If you
need an operand in a particular register, see
http://gcc.gnu.org/onlinedocs/gcc/Local-Reg-Vars.html etc.
-Eli
More information about the llvm-dev
mailing list