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


> Richard Henderson wrote:
> > On Thu, Aug 23, 2001 at 06:53:25PM +0200, Jan Hubicka wrote:
> > > * i386.md (cmpstr peep2): Delete.
> >
> > Ok.
> 
> Not so fast - they're still necessary.  This test case
> 
> extern void bar(void);
> void foo(char *x) { if (!strcmp (x, "b"))  bar(); }
> 
> generates worse code without them:
> 
> --- test.s      	 Fri Aug 24 09:14:38 2001
> +++ test.s.no-peepholes  Fri Aug 24 09:09:45 2001
> @@ -19,6 +19,9 @@
>         movl    8(%ebp), %esi
>         repz
>         cmpsb
> +       seta    %dl
> +       setb    %al
> +       cmpb    %al, %dl
>         je      .L3
>         movl    (%esp), %esi
>         movl    4(%esp), %edi
>  
> Jan, if you would please find out why your noop-move code does not
> work for this case, before removing the peepholes?
Thats strange - I was trying de-facto equivalent testcase and it did work.
(I believe my one changed return value instead of callinf function)

I will try to figure out what is going on overnight. Thanks for pointing it out.

Honza
> 
> zw


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