]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
combine: Don't mess with subregs of floating point (PR78590)
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Nov 2016 08:24:59 +0000 (08:24 +0000)
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Nov 2016 08:24:59 +0000 (08:24 +0000)
PR78590 shows a problem in change_zero_ext, where we change a zero_extend
of a subreg to a logical and.  We should only do this if the thing we are
taking the subreg of is a scalar integer, otherwise we will take a subreg
of (e.g.) a float in a different size, which is nonsensical and hits an
assert.

PR rtl-optimization/78590
* combine.c (change_zero_ext): Transform zero_extend of subregs only
if the subreg_reg is a scalar integer mode.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242999 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/combine.c

index 1b8e061c873e07a8bb9bc923a08c030c8db578f5..1febcad25e58781d916a0f75b9af7160509c8b41 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-30  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR rtl-optimization/78590
+       * combine.c (change_zero_ext): Transform zero_extend of subregs only
+       if the subreg_reg is a scalar integer mode.
+
 2016-11-30  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/78586
index a32a0ecc72fba6cac9eda0bee0eda5e460f2675c..a8dae89d7b325de5d3f30459da92166a81f88685 100644 (file)
@@ -11251,6 +11251,7 @@ change_zero_ext (rtx pat)
       else if (GET_CODE (x) == ZERO_EXTEND
               && SCALAR_INT_MODE_P (mode)
               && GET_CODE (XEXP (x, 0)) == SUBREG
+              && SCALAR_INT_MODE_P (GET_MODE (SUBREG_REG (XEXP (x, 0))))
               && !paradoxical_subreg_p (XEXP (x, 0))
               && subreg_lowpart_p (XEXP (x, 0)))
        {