This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16721] [3.5 Regression] Accesses to volatile objects optimized away
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jul 2004 19:04:31 -0000
- Subject: [Bug c/16721] [3.5 Regression] Accesses to volatile objects optimized away
- References: <20040726181156.16721.macro@linux-mips.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From falk at debian dot org 2004-07-26 19:04 -------
I can reproduce this on alphaev68-linux.
In the test case you gave, removing the access seems entirely appropriate
to me, since addr is not volatile.
However, the same happens if you mark it volatile, so this is really a bug.
-fno-strict-aliasing is a red herring; the access also gets optimized away for
struct data { volatile unsigned long addr; } p;
void test() { p.addr; }
at -O2.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |wrong-code
Known to fail| |3.5.0
Known to work| |3.3.4
Summary|Accesses to volatile objects|[3.5 Regression] Accesses to
|optimized away with -fno- |volatile objects optimized
|strict-aliasing |away
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16721