This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jeff Law <law at redhat dot com>, Mike Stump <mikestump at comcast dot net>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Sandiford <rdsandiford at googlemail dot com>, Eric Botcazou <ebotcazou at adacore dot com>
- Date: Tue, 13 Jan 2015 11:38:34 -0600
- Subject: Re: shift/extract SHIFT_COUNT_TRUNCATED combine bug
- Authentication-results: sourceware.org; auth=none
- References: <8F47DDC3-F9FE-4E94-90F7-3A16A3FD47CE at comcast dot net> <54B446B2 dot 6080909 at redhat dot com> <CAFiYyc2t83m8mccgSdfa0k6wDXub-9uTwehXJxCmq9WzcNPVwg at mail dot gmail dot com>
On Tue, Jan 13, 2015 at 10:51:27AM +0100, Richard Biener wrote:
> IMHO SHIFT_COUNT_TRUNCATED should be removed and instead
> backends should provide shift patterns with a (and:QI ...) for the
> shift amount which simply will omit that operation if suitable.
Note that that catches less though, e.g. in
int f(int x, int n) { return x << ((2*n) & 31); }
without SHIFT_COUNT_TRUNCATED it will try to match an AND with 30,
not with 31.
Segher