Re: asm volatile statement reordering

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

 



On 17/10/17 13:32, David Brown wrote:
> No, you can't - not always.  Memory clobbers enforce an ordering on data
> that is stored in memory or loaded from memory.  They don't affect data
> in registers, and they don't affect code execution and calculations.

Yes, of course.  So you need to insert *artificial* dependencies, as needed,
to make the ordering explicit.

> And memory clobbers are expensive on many targets, as are alternatives
> like making extra volatile variables.

But you show in the rest of your mail that you do understand the issue, and
some solutions.  The "do not perform this expensive operation while interrupts
are disabled" problem is indeed tricky because GCC doesn't model time at this
level.  But there are ways to be explicit, and you evidently know what they are.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



[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