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 and R/M/W operations


Samuel Tardieu wrote:

For this pattern (isolated setting of one bit in the middle of a byte at
a random memory location), this is the best code on this platform AFAIK.

As an evidence, if you mark neither variable as volatile GCC generates
with -O3 -fomit-frame-pointer:

f:
        orb     $16, x
        orb     $32, y
        ret

And I sure expect that GCC didn't choose to generate worst code when
I *removed* the volatile constraint :)

OK, sounds reasonable, but then I don't understand the logic behind avoiding this instruction sequence for the volatile case, this is two accesses at the bus level so what's the difference? I think on earlier pentiums these instructions were supposed to be avoided but of course this may have changed.


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