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/43110] Lack of dependency between %rax and %eax in inline assembly



------- 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


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