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]

Re: Incrementing volatiles?


Sorry to be slightly off-topic, but this discussion reminds me a problem
I encountered some months ago when writing a driver for a VME board in
an AIX powerpc environment.  Although I had declared all the registers
of the chips on the board as volatile, and compiled my driver with gcc,
I saw with a logic analyser on the VME bus that the accesses to the
register on the board were not done in the order I had written them.
To solve that problem, I had to manually add asm("eieio") after each
access to a volatile register.  Should gcc not do that for me ?

eieio stands for "Enforce In-Order Execution of I/O".  Without it a powerpc
processor assumes that it may reorder the load and stores to memory-mapped
I/O registers.


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