This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Thoughts on memcmp expansion (PR43052)
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Nick Clifton <nickc at redhat dot com>
- Date: Fri, 13 May 2016 15:05:36 +0200
- Subject: Re: Thoughts on memcmp expansion (PR43052)
- Authentication-results: sourceware.org; auth=none
- References: <56992541 dot 3090402 at redhat dot com> <CAFiYyc1NX9V9sM=cij75qAGYqGpXGM=1ZioB8cxWNZxsW=uJeQ at mail dot gmail dot com> <5722581B dot 5050402 at redhat dot com> <CAFiYyc3Nvb3Om81Fs6eGpc7oOkvQxJD7Qa_RP-AQh3x_-w-LRw at mail dot gmail dot com> <57274ECF dot 3060909 at redhat dot com> <CAFiYyc3CVOA-wwzeKVkOyKRVOzDS45C3h4PuvACJ1ZWDpRAqwQ at mail dot gmail dot com> <5734B9DF dot 9000505 at redhat dot com> <CAFiYyc1Pq6CBaQ2zrjYW6V4Cz8KGSRzuEmbTN4H9io_-H0y4Gw at mail dot gmail dot com>
On 05/13/2016 12:20 PM, Richard Biener wrote:
I'm not much of a fan of C++-ification (in this case it makes review
harder) but well ...
I felt it was a pretty natural way to structure the code to avoid
duplicating the same logic across more functions, and we might as well
use the language for such purposes given that we've bothered to switch.
+ if (tree_fits_uhwi_p (len)
+ && (leni = tree_to_uhwi (len)) <= GET_MODE_SIZE (word_mode)
+ && exact_log2 (leni) != -1
+ && (align1 = get_pointer_alignment (arg1)) >= leni * BITS_PER_UNIT
+ && (align2 = get_pointer_alignment (arg2)) >= leni * BITS_PER_UNIT)
I think * BITS_PER_UNIT has to be * 8 here as the C standard defines
it that way.
Huh? Can you elaborate?
[...]
Ok with those changes.
Thanks. I won't be reading email for the next two weeks, so I'll be
checking it in afterwards.
Bernd