Re: gcc optimises out test of value in register-only loop

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

 



Andrew Haley <aph@xxxxxxxxxx> writes:

> On 10/14/2011 05:41 AM, Ian Lance Taylor wrote:
>> MikeW <mw_phil@xxxxxxxxxxx> writes:
>> 
>>>   volatile register int stop_loop __asm("r5")__;
>> 
>> gcc does not support volatile register variables.  I think it could be
>> meaningful, but it has never worked.
>
> It would be really nasty to implement: we'd have to check for volatility
> on every access to a hard register.  The benefits don't seem worth it,
> IMO.

No, it's not that bad.  At the tree level, we would only have to check
on every reference to a DECL for which DECL_REGISTER is true.  When
expanding to RTL, we would replace each reference with a special
UNSPEC_VOLATILE which we handle specially when generating asm code.  Or
perhaps simply expand each reference to a specially handled asm
statement.

Ian


[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