+2020-01-31 Tamar Christina <tamar.christina@arm.com>
+
+ PR rtl-optimization/91838
+ * simplify-rtx.c (simplify_binary_operation_1): Update LSHIFTRT case
+ to truncate if allowed or reject combination.
+
2020-01-31 Andrew Stubbs <ams@codesourcery.com>
* tree-ssa-loop-ivopts.c (get_iv): Use sizetype for zero-step.
{
rtx tmp = gen_int_shift_amount
(inner_mode, INTVAL (XEXP (SUBREG_REG (op0), 1)) + INTVAL (op1));
- tmp = simplify_gen_binary (code, inner_mode,
- XEXP (SUBREG_REG (op0), 0),
- tmp);
+
+ /* Combine would usually zero out the value when combining two
+ local shifts and the range becomes larger or equal to the mode.
+ However since we fold away one of the shifts here combine won't
+ see it so we should immediately zero the result if it's out of
+ range. */
+ if (code == LSHIFTRT
+ && INTVAL (tmp) >= GET_MODE_BITSIZE (inner_mode))
+ tmp = const0_rtx;
+ else
+ tmp = simplify_gen_binary (code,
+ inner_mode,
+ XEXP (SUBREG_REG (op0), 0),
+ tmp);
+
return lowpart_subreg (int_mode, tmp, inner_mode);
}
+2020-01-31 Tamar Christina <tamar.christina@arm.com>
+
+ PR rtl-optimization/91838
+ * g++.dg/pr91838.C: New test.
+
2020-01-30 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/analyzer/malloc-1.c: Remove include of <string.h>.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-O2" } */
+/* { dg-skip-if "" { *-*-* } {-std=c++98} } */
+
+using T = unsigned char; // or ushort, or uint
+using V [[gnu::vector_size(8)]] = T;
+V f(V x) {
+ return x >> 8 * sizeof(T);
+}
+
+/* { dg-final { scan-assembler {pxor\s+%xmm0,\s+%xmm0} { target x86_64-*-* } } } */