------- Comment #3 from hjl dot tools at gmail dot com 2010-06-25 16:43 -------
Another testcase:
[...@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;
}
[...@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
[...@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