[Bug c/43782] Erroneous expansion of __asm__() directive

pinskia at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 19 15:07:00 GMT 2010



------- Comment #6 from pinskia at gmail dot com  2010-04-19 15:07 -------
Subject: Re:  Erroneous expansion of __asm__() directive



Sent from my iPhone

On Apr 19, 2010, at 7:35 AM, "Nelson H. F. Beebe"  
<beebe@math.utah.edu> wrote:

>>> That is wrong because with AT&T style x86 asm, the src is first  
>>> and the dest is
>>> second.
>
> That cannot be the case: you cannot change the operand order after  
> three
> years of it working one way!

It did not change. Just what happened was gcc is now inlining the  
function. Before it was not inlining the function which allowed the  
inline-asm's two operands to be the same (the argument to the function  
and the return value are done in the same register). Which means you  
were just getting lucky that it worked. In fact AT&T asm has always  
been that way; while intel style asm is the opposite. Gcc outputs AT&T  
by default, though you can change it via an option.


>
> --- 
> --- 
> --- 
> ----------------------------------------------------------------------
> - Nelson H. F. Beebe                    Tel: +1 801 581  
> 5254                  -
> - University of Utah                    FAX: +1 801 581  
> 4148                  -
> - Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu 
>   -
> - 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org 
>  -
> - Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ 
>  -
> --- 
> --- 
> --- 
> ----------------------------------------------------------------------


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43782



More information about the Gcc-bugs mailing list