This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix up expand_small_movmem_or_setmem (PR target/59003)
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Uros Bizjak <ubizjak at gmail dot com>, Richard Henderson <rth at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Jan 2014 20:08:19 +0100
- Subject: Re: [PATCH] Fix up expand_small_movmem_or_setmem (PR target/59003)
- Authentication-results: sourceware.org; auth=none
- References: <20140121190211 dot GQ892 at tucnak dot redhat dot com>
> Hi!
>
> As the testcase shows, for the memset (x, 0, y); snippet which handles
> y from 16 to 31 inclusive for some tunings, we generate:
> .L36:
> movq $0, (%rdi)
> movq $0, 8(%rdi)
> movq $0, -8(%rsi,%rdi)
Oops...
> which is correct only for y from 16 to 24 inclusive, if y is 25 to 31,
> we clear the first 16 bytes and last 8 bytes of the buffer, but would leave
> 1 to 7 bytes untouched in between that.
> With this patch we emit:
> .L36:
> movq $0, (%rdi)
> movq $0, 8(%rdi)
> movq $0, -16(%rsi,%rdi)
> movq $0, -8(%rsi,%rdi)
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2014-01-21 Jakub Jelinek <jakub@redhat.com>
>
> PR target/59003
> * config/i386/i386.c (expand_small_movmem_or_setmem): If mode is
> smaller than size, perform several stores or loads and stores
> at dst + count - size to store or copy all of size bytes, rather
> than just last modesize bytes.
>
> * gcc.dg/tree-prof/pr59003.c: New test.
Yes, this is OK. Thanks a lot for looking into that! This PR was on my TODO
list for way too long (mostly because compilation farm machines are unasy
to debug profiledbootstrap errors and I got new devel machine only last week).
Honza