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

Optimization and reading/writing to register locations


This is sort of vague, but in embedded applications
that read from or write to particular memory addresses
 (ie hardware registers), is there any risk of these
reads/writes being "optimized away"?

Ie, if I have this in the code:

int i;

*((int *) 0xffee0000) = 5;

i = *((int *) 0xffee0000);

Are all lines guaranteed to execute with -O, -O2, and
-O3?

Thanks very much.

-Ryan Hajdaj


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com


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