[Bug optimization/10817] gcc does not optimize result=0;if(t!=0)result=t; to result=t;

pinskia@physics.uc.edu gcc-bugzilla@gcc.gnu.org
Sun May 25 01:29: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=10817



------- Additional Comments From pinskia@physics.uc.edu  2003-05-25 00:22 -------
It also happens on i686-pc-linux-gnu:
.globl h
        .type   h, @function
h:
        movl    4(%esp), %eax
        xorl    %edx, %edx
        testl   %eax, %eax
        je      .L1
        movl    %eax, %edx
.L1:
        movl    %edx, %eax
        ret
        .size   h, .-h
        .p2align 4,,15
.globl h1
        .type   h1, @function
h1:
        movl    4(%esp), %eax
        xorl    %edx, %edx
        testl   %eax, %eax
        je      .L5
        movl    %eax, %edx
.L5:
        movl    %edx, %eax
        ret
        .size   h1, .-h1
        .ident  "GCC: (GNU) 3.4 20030524 (experimental)"

So maybe the optimization is Alpha specific.



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