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 tree-optimization/27504] New: x && (x & y) not optimized to x & y


Example:

falk@juist:/tmp% cat test.c 
int f(int x) { return x && (x & 0x55); }

falk@juist:/tmp% gcc -c -O3  test.c && objdump -d test.o
0000000000000000 <f>:
   0:   00 04 ff 47     clr     v0
   4:   02 00 00 e6     beq     a0,10 <f+0x10>
   8:   01 b0 0a 46     and     a0,0x55,t0
   c:   a0 03 e1 43     cmpult  zero,t0,v0
  10:   01 80 fa 6b     ret


-- 
           Summary: x && (x & y) not optimized to x & y
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: falk at debian dot org


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


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