This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] combine: Convert subreg-of-lshiftrt to zero_extract properly (PR78390)
- From: Dominik Vogt <vogt at linux dot vnet dot ibm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Michael Matz <matz at suse dot de>
- Date: Wed, 30 Nov 2016 14:12:35 +0100
- Subject: Re: [PATCH] combine: Convert subreg-of-lshiftrt to zero_extract properly (PR78390)
- Authentication-results: sourceware.org; auth=none
- References: <9f8b8662c941ed5972a6f61b9da0fa7dd81409ff.1479910323.git.segher@kernel.crashing.org>
- Reply-to: vogt at linux dot vnet dot ibm dot com
On Wed, Nov 23, 2016 at 02:22:07PM +0000, Segher Boessenkool wrote:
> r242414, for PR77881, introduces some bugs (PR78390, PR78438, PR78477).
> It all has the same root cause: that patch makes combine convert every
> lowpart subreg of a logical shift right to a zero_extract. This cannot
> work at all if it is not a constant shift, and it has to be a bit more
> careful exactly which bits it extracts.
>
> Tested on powerpc64-linux {-m32,-m64} (where it fixes the regression
> c-c++-common/torture/vector-compare-1.c fails at -O1, and where it also
> has a bootstrap failure with some other patches). Also tested that the
> x86_64 compiler still generates the wanted code for the PR77881 testcase.
Is this a side effect of the patch series?
Trying 7 -> 9:
...
Failed to match this instruction:
(set (reg:SI 68 [ v_or ])
(ior:SI (subreg:SI (zero_extract:DI (reg:DI 2 %r2 [ v_x ])
^^^^^^^^^^^^^^^^^^^^^^^^^^
(const_int 16 [0x10])
(const_int 0 [0])) 4)
^^^
(reg:SI 70 [ v_and1 ])))
Shouldn't this be simply
...
(ior:SI (zero_extract:SI (reg:DI) (16) (0)))
...
?
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
IBM Germany