[Bug c/38616] Wrong code when -O3 or -O2 used

socketpair at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Dec 24 13:35:00 GMT 2008



------- Comment #2 from socketpair at gmail dot com  2008-12-24 13:33 -------
(From update of attachment 16979)
        .file   "zzz2.c"
        .text
        .p2align 4,,15
.globl main
        .type   main, @function
main:
        leal    4(%esp), %ecx
        andl    $-16, %esp
        pushl   -4(%ecx)
        pushl   %ebp
        movl    %esp, %ebp
        subl    $1064, %esp
        movl    %gs:20, %eax
        movl    %eax, -12(%ebp)
        xorl    %eax, %eax
        movl    %ecx, -8(%ebp)
        movl    $255, %ecx
        movl    %edi, -4(%ebp)
        leal    -1032(%ebp), %edi
        movl    $875770417, -1036(%ebp)
        movl    $1650536505, -1028(%ebp)
        movl    $1717920867, -1024(%ebp)
        rep stosl
        leal    -1036(%ebp), %eax
        movl    $943142453, -1032(%ebp)
        movl    $1785292903, -1020(%ebp)
        movl    $1852664939, -1016(%ebp)
        movw    $111, -1012(%ebp)
        movl    %eax, (%esp)
        call    puts
        xorl    %eax, %eax
        movl    -12(%ebp), %edx
        xorl    %gs:20, %edx
        jne     .L6
        movl    -8(%ebp), %ecx
        movl    -4(%ebp), %edi
        movl    %ebp, %esp
        popl    %ebp
        leal    -4(%ecx), %esp
        ret
.L6:
        call    __stack_chk_fail
        .size   main, .-main
        .ident  "GCC: (Ubuntu 4.3.2-1ubuntu11) 4.3.2"
        .section        .note.GNU-stack,"",@progbits


-- 


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



More information about the Gcc-bugs mailing list