This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Optimization and reading/writing to register locations
- From: Ryan Hajdaj <rhajdaj at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 19 Oct 2004 12:52:23 -0700 (PDT)
- Subject: 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