[Bug c/22072] bizarre code for int*int/2
felix-gcc at fefe dot de
gcc-bugzilla@gcc.gnu.org
Wed Jun 15 06:12:00 GMT 2005
------- Additional Comments From felix-gcc at fefe dot de 2005-06-15 06:12 -------
by the way, -Os generates an unnecessary register move:
pushl %ebp
movl $2, %edx
movl %esp, %ebp
movl 12(%ebp), %eax
movl %edx, %ecx
imull 8(%ebp), %eax
popl %ebp
cltd
idivl %ecx
ret
gcc should put the $2 directly in %ecx here. Or it should note that "mov
$2,%ecx; idiv %ecx" is 7 bytes, while "sar %eax" is only two bytes, and emit the
latter.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22072
More information about the Gcc-bugs
mailing list