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 tree-optimization/19778] Unnecessary jumps for comparisons


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-04 18:19 -------
I think this is fixed on the mainline, for x86, in 4.0.0 we get:
        movl    4(%esp), %edx
        testl   %edx, %edx
        je      .L2
        leal    -1(%edx), %eax
        xorl    %ecx, %ecx
        testl   %eax, %edx
        jne     .L5
.L2:
        movl    $1, %ecx
.L5:
        movl    %ecx, %eax
        ret

But on the mainline we get:
        movl    4(%esp), %edx
        movl    $1, %eax
        testl   %edx, %edx
        je      .L4
        leal    -1(%edx), %eax
        testl   %eax, %edx
        sete    %al
        movzbl  %al, %eax
.L4:
        ret

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|alphaev68-unknown-linux-gnu |
   GCC host triplet|alphaev68-unknown-linux-gnu |
 GCC target triplet|alphaev68-unknown-linux-gnu |alphaev68-*-linux-gnu


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


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