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

[Bug target/12598] New: Invalid size optimization on volatile memory reference


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".


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