This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/43110] Lack of dependency between %rax and %eax in inline assembly
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2010 23:15:14 -0000
- Subject: [Bug inline-asm/43110] Lack of dependency between %rax and %eax in inline assembly
- References: <bug-43110-18804@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2010-02-17 23:15 -------
Your inline-asm is incorrect as you don't say that result is ax (including eax
and rax) is going to be early clobbered.
The inline-asm should be written as:
asm volatile (
"movq $0x0102030405060708, %%rax\n\t"
"mov %1, %%eax\n\t"
: "=&a" (result)
: "r" (vv)
);
The same thing is true for the inline-asm in your locateEndToken. You should
mark the two outgoing registers as early clobbered. Without it, GCC assumes
the incoming registers are used before the output registers are used but in
your case, we use the incoming registers after you set the outgoing register.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Component|c |inline-asm
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43110