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 rtl-optimization/44659] Combiner fails to match QI cmp patterns with upper 8bit register



------- Comment #3 from hjl dot tools at gmail dot com  2010-06-25 16:43 -------
Another testcase:

[hjl@gnu-6 44659]$ cat extract-3.c
typedef struct
{
  unsigned char c1;
  unsigned char c2;
  unsigned char c3;
  unsigned char c4;
} foo_t;

int
foo (foo_t x)
{
   return x.c2 != 0;
}
[hjl@gnu-6 44659]$ make extract-3.s
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -Os -S extract-3.c
[hjl@gnu-6 44659]$ cat extract-3.s
        .file   "extract-3.c"
        .text
.globl foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        movl    %edi, %eax
        movzbl  %ah, %edi
        xorl    %eax, %eax
        testb   %dil, %dil
        setne   %al
        ret

movzbl  %ah, %edi
testb   %dil, %dil

can be combined into one instruction.


-- 


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


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