avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] [bug #37778] _MemoryBarrier() in cpufunc.h error on c


From: Georg-Johann Lay
Subject: Re: [avr-libc-dev] [bug #37778] _MemoryBarrier() in cpufunc.h error on compile
Date: Sun, 27 Jan 2013 18:22:50 +0100
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Dmitry Xmelkov a écrit:
Follow-up Comment #2:

What is the necessity to add memory barrier for _NOP()?
Common usage, like:
    PORTB |= 1;
    _NOP();
    PORTB &= ~1;
is safe, as hardware registers are volatile.

Question is whether or not NOP should be allowed to be moved across
ordinary memory moves.

For SEI and CLI, for example, I think this is not wanted in general.

NOP is less intrusive than SEI / CLI, of course, but avr-gcc emits
__builtin_avr_nop() with a memory clobber:

http://gcc.gnu.org/viewcvs/trunk/gcc/config/avr/avr.md?revision=195151&view=markup#l5938




reply via email to

[Prev in Thread] Current Thread [Next in Thread]