[forwarded from http://bugs.debian.org/288721]

This fails with 3.3.5 at -O and higher. Regression from 2.95. Also doesn't fail
on MIPS or Alpha. Debian 3.4.4 20041218 is OK.

void abort(void);
__attribute__((noinline)) void f(unsigned short ad) {
    if (ad >= 0x4000 && ad < 0xc000) 
        abort();
}

int main(void) {
    f(0xff00); 
    return 0;
}

-- 
           Summary: [3.3 regression] Range check on short miscompiled at -O
           Product: gcc
           Version: 3.3.5
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: falk at debian dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-linux
  GCC host triplet: i386-linux
GCC target triplet: i386-linux


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

Reply via email to