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

             Bug #: 50962
           Summary: Additional opportunity for AGU stall avoidance
                    optimization for Atom processor
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: izamya...@gmail.com


We have now following code for attached testcase:

foo:
.LFB0:
        .cfi_startproc
        movl    4(%esp), %eax
        testl   %eax, %eax
        je      .L4
        xorl    %ecx, %ecx
        jmp     .L3
        .p2align 4,,7
        .p2align 3
.L5:
        movl    %eax, %ecx
        movl    %edx, %eax
.L3:
        movl    (%eax), %edx <--- AGU stall here on Atom since eax produced on
previous cycle. We should use lea in previous instruction.
        movl    %ecx, (%eax)
        testl   %edx, %edx
        jne     .L5
        ret
.L4:
        xorl    %eax, %eax
        ret
        .cfi_endproc

 So we can use lea before movl (%eax), %edx which is better for Atom.

Reply via email to