[Bug middle-end/26729] [4.0,4.1 regression] bad bitops folding

falk at debian dot org gcc-bugzilla@gcc.gnu.org
Tue Mar 28 21:59:00 GMT 2006



------- Comment #11 from falk at debian dot org  2006-03-28 21:59 -------
Ah. I can reproduce it now. Here is a C test case:

void abort(void);

__attribute__((noinline))
int f (unsigned short word) {  
  return (word & 0x1) && (((unsigned short) (word & 0x8000)) == 0x8000);
}

int main(void) {
  if (!f(0x8001))
    abort();
  return 0;
}


-- 

falk at debian dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c++                         |middle-end
     Ever Confirmed|0                           |1
           Keywords|diagnostic                  |wrong-code
      Known to fail|3.4.3 3.3.3 4.0.2 4.1.0     |3.3.6 3.4.3 4.0.2 4.1.0
                   |                            |4.2.0
      Known to work|                            |2.95.4
            Summary|bogus 'comparison is always |[4.0,4.1 regression] bad
                   |0' message                  |bitops folding


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



More information about the Gcc-bugs mailing list