------- 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