This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/22072] bizarre code for int*int/2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]