https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70321
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
"and" is also less optimized:
[hjl@gnu-tools-1 bitwise-1]$ cat and.i
extern long long x;
void
foo (long long ixi)
{
x = ixi & 14348907;
}
[hjl@gnu-tools-1 bitwise-1]$ make and.s
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fno-asynchronous-unwind-tables
-O2 -m32 -S -o and.s and.i
[hjl@gnu-tools-1 bitwise-1]$ make and1.s
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -fno-asynchronous-unwind-tables
-O2 -m32 -mno-stv -S -o and1.s and.i
[hjl@gnu-tools-1 bitwise-1]$ cat and.s
.file "and.i"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
movl 4(%esp), %eax
movl 8(%esp), %edx
andl $14348907, %eax
andl $0, %edx
movl %eax, x
movl %edx, x+4
ret
.size foo, .-foo
.ident "GCC: (GNU) 6.0.0 20160318 (experimental)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-tools-1 bitwise-1]$ cat and1.s
.file "and.i"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
movl 4(%esp), %eax
movl $0, x+4
andl $14348907, %eax
movl %eax, x
ret
.size foo, .-foo
.ident "GCC: (GNU) 6.0.0 20160318 (experimental)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-tools-1 bitwise-1]$