This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/12598] New: Invalid size optimization on volatile memory reference
- From: "hp at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Oct 2003 14:14:03 -0000
- Subject: [Bug target/12598] New: Invalid size optimization on volatile memory reference
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12598
Summary: Invalid size optimization on volatile memory reference
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Keywords: wrong-code
Severity: critical
Priority: P3
Component: target
AssignedTo: hp at gcc dot gnu dot org
ReportedBy: hp at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: Any, supposedly
GCC host triplet: Any, supposedly
GCC target triplet: cris-*
Compile with e.g. -O2, the following code:
static const unsigned long c = 0x0000FF00;
unsigned long
a1 (void)
{
unsigned long m;
m = *(volatile unsigned long*) 0xb00000c8;
m &= c;
return m;
}
Note the memory reference is done as a 16-bit, not 32-bit access;
specifically a "movu.w".