This is the mail archive of the gcc-patches@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]

Re: obsolette peep2s


On Fri, Aug 24, 2001 at 06:20:02PM +0200, Jan Hubicka wrote:
> Thats strange - I was trying de-facto equivalent testcase and it did work.
> (I believe my one changed return value instead of callinf function)

When the only difference is the return value, some pass or other is
able to collapse the basic blocks - which might make combine's job 
easier.  However, having said that, I still get unnecessary set and
cmp instructions from

int foo(char *x) { if (!strcmp (x, "b")) return 20; return 0; }

--- test2.s     Fri Aug 24 09:32:33 2001
+++ test2.s.nopeep      Fri Aug 24 09:30:18 2001
@@ -21,6 +21,9 @@
        cmpsb
        movl    4(%esp), %edi
        movl    (%esp), %esi
+       setb    %al
+       seta    %dl
+       cmpb    %al, %dl
        sete    %al
        movl    %ebp, %esp
        popl    %ebp
        movzbl  %al, %eax
        decl    %eax
        andl    $-20, %eax
        addl    $20, %eax
        ret

zw


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