This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -O2 and volatile
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: Marcus Binny <marcusbinny at yahoo dot com>, gcc at gcc dot gnu dot org
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 02 Oct 2003 06:42:05 -0500
- Subject: Re: -O2 and volatile
Hi Marcus,
Can you post a small, complete code example that exhibits the broken behavior you mentioned?
Which version of GCC? On what platform?
Have you looked at the assembly output (.s file extension), using the "-save-temps" flag, to see which variables GCC took the liberty to eliminate?
In my experience, sometimes the errant behavior (presuming its GCC and not the code ... which it sometimes has been a flaw in GCC) can be corrected by using the appropriate "-fno-fubaroptimization".
Thanks,
--Eljay