This is the mail archive of the gcc@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]

Re: volatile access optimization (C++ / x86_64)


> On Jan 5, 2015, at 4:11 PM, DJ Delorie <dj@redhat.com> wrote:
> 
> 
>> To try to generalize from that: it looks like the operating
>> principle is that an insn that expands into multiple references to a
>> given operand isnât volatile-safe, but one where there is only a
>> single reference is safe?
> 
> No, if the expanded list of insns does "what the standard says, no
> more, no less" as far as memory accesses go, it's OK.  Many of the MSP
> macros do not access memory in a volatile-safe way.  Some do.
> 
> If you have a single opcode that isn't volatile-safe (for example, a
> string operation that's interruptable and restartable), that wouldn't
> be OK despite being a single insn.

Ok, but the converse â if the general_operand is accessed by more than one instruction, it is not safe â is correct, right?

> 
> So it's kinda mechanical, but not always.

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