A function that dereferences an absolute address in memory, e.g.:

  int test (void)
  {
    return * (volatile int *) 0x1234;
  }

Is incorrectly identified by the ipa-pure-const pass as being pure, resulting 
in invalid optimizations 
being performed.

This can be seen in the ipa-pure-const dump file:

  Function found to be pure: test

-- 
           Summary: ipa-pure-const pass ignores dereferencing a volatile
                    pointer type
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jconner at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: all


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23584

Reply via email to