[Bug target/9359] [Athlon] odd performance behavior on Athlon XP1800+

pinskia@physics.uc.edu gcc-bugzilla@gcc.gnu.org
Mon May 26 18:04:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From pinskia@physics.uc.edu  2003-05-26 18:00 -------
-O0 means no optimization meaning that it will be slow, gcc spills many things on the 
stack so any speed differences are caused by the spilling.  the difference between -O2 
and -O0 (+ is -O0, - is -O2):
 .globl main
        .type   main, @function
 main:
        pushl   %ebp
        movl    %esp, %ebp
-       subl    $8, %esp
+       pushl   %ebx
+       subl    $4, %esp
+       movl    $100000000, %ebx
        andl    $-16, %esp
-       movl    $0, %eax
-       subl    %eax, %esp
-       movl    $0, -8(%ebp)
-       cmpl    $0, -8(%ebp)
-       je      .L3
+       .p2align 4,,15
+.L7:
        call    foo
-.L3:
-       movl    $0, -4(%ebp)
-.L4:
-       cmpl    $100000000, -4(%ebp)
-       jg      .L5
-       call    foo
-       leal    -4(%ebp), %eax
-       incl    (%eax)
-       jmp     .L4
-.L5:
+       decl    %ebx
+       jns     .L7
+       movl    -4(%ebp), %ebx
        leave
        ret



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Gcc-bugs mailing list