Re: Incorrect asm constraints or GCC bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/19/2012 11:28 AM, Florian Weimer wrote:
> Note how %0 and %3 are assigned the same register.  Changing "=r" to 
> "+r" fixes this.  If an output-only operand must be modified last, the 
> original register assignment would be correct, but the Extended Asm 
> documentation does not require such a thing.

It does.

"Unless an output operand has the `&' constraint modifier, GCC may
allocate it in the same register as an unrelated input operand, on the
assumption the inputs are consumed before the outputs are produced."

Have a look at the documentation for "earlyclobber".  It's perfectly
reasonable to reuse a register used for an input as an output, and gcc
would generate far worse code if it couldn't do this.

Andrew.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux