------- Comment #1 from ubizjak at gmail dot com  2007-07-07 08:22 -------
This is fixed in gcc-4.3:

_Z3fooPyPKyy:
        movq    %rdx, %rax
        mulq    (%rsi)
        movq    %rdx, (%rdi)
        ret

_Z3fooPyPKyyy:
        andq    (%rsi), %rcx
        movq    %rcx, %rax
        mulq    %rdx
        movq    %rdx, (%rdi)
        ret

_Z4foo2PyPKyy:
        movq    %rdx, %r8
        movq    %rdx, %rax
        pushq   %rbx             <<< here
        mulq    (%rsi)
        popq    %rbx             <<< here
        movq    %rdx, (%rdi)
        movq    8(%rsi), %rax
        mulq    %r8
        movq    %rdx, 8(%rdi)
        ret

_Z4foo2PyPKyyy:
        movq    %rcx, %r9
        andq    (%rsi), %r9
        movq    %rdx, %r10
        movq    %r9, %rax
        mulq    %rdx
        movq    %rdx, (%rdi)
        andq    8(%rsi), %rcx
        movq    %rcx, %rax
        mulq    %r10
        movq    %rdx, 8(%rdi)
        ret

A lot of infrastructure changes were introduced during gcc-4.3 development
(subregs splitting, dataflow) to produce the code above, and these changes
surely won't get ported to release branches.

Saving and restoring %rbx is not needed in foo2 case, perhaps dataflow experts
know why it is still generated?


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32662

Reply via email to