[Bug rtl-optimization/47521] New: Unnecessary usage of edx register
tony.poppleton at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Jan 28 18:42:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47521
Summary: Unnecessary usage of edx register
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: tony.poppleton@gmail.com
In testing PR46235 I noticed some minor inefficiency in the usage of an extra
register.
The C code is:
int foo(int a, int x, int y)
{
if (a & (16))
return a;
return 1;
}
Which produces the asm:
movl %edi, %eax
movl $1, %edx
testb $16, %al
cmove %edx, %eax
ret
The above code could have been further optimized to remove the usage of edx:
movl $1, %eax
test $16, %edi
cmove %edi, %eax
ret
More information about the Gcc-bugs
mailing list