This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: obsolette peep2s
- To: Zack Weinberg <zackw at panix dot com>
- Subject: Re: obsolette peep2s
- From: Jan Hubicka <jh at suse dot cz>
- Date: Fri, 24 Aug 2001 18:20:02 +0200
- Cc: Jan Hubicka <jh at suse dot cz>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org, patches at x86-64 dot org
- References: <20010824121643.A8422@panix.com>
> 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