This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]