The comment for the added case to simplify_truncation reads
/* Turn (truncate:M1 (*_extract:M2 (reg:M2) (len) (pos))) into
(*_extract:M1 (truncate:M1 (reg:M2)) (len) (pos')) if possible without
changing len. */
but I forgot to check the two modes M2 are actually the same.
PR rtl-optimization/78583
* simplify-rtx.c (simplify_truncation): Add check missing from the
previous commit.
From-SVN: r243000
+2016-11-30 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/78583
+ * simplify-rtx.c (simplify_truncation): Add check missing from the
+ previous commit.
+
2016-11-30 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/78590
changing len. */
if ((GET_CODE (op) == ZERO_EXTRACT || GET_CODE (op) == SIGN_EXTRACT)
&& REG_P (XEXP (op, 0))
+ && GET_MODE (XEXP (op, 0)) == mode
&& CONST_INT_P (XEXP (op, 1))
&& CONST_INT_P (XEXP (op, 2)))
{