2016-11-25 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/78526
+ * simplify-rtx.c (simplify_immed_subreg): Don't use wi::extract_uhwi
+ beyond val's precision.
+
PR rtl-optimization/78527
* combine.c (make_compound_operation_int): Ignore LSHIFTRT with
out of bounds shift count.
{
rtx_mode_t val = rtx_mode_t (el, innermode);
unsigned char extend = wi::sign_mask (val);
+ int prec = wi::get_precision (val);
- for (i = 0; i < elem_bitsize; i += value_bit)
+ for (i = 0; i < prec && i < elem_bitsize; i += value_bit)
*vp++ = wi::extract_uhwi (val, i, value_bit);
for (; i < elem_bitsize; i += value_bit)
*vp++ = extend;
+2016-11-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/78526
+ * gcc.dg/pr78526.c: New test.
+
2016-11-25 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/77541
--- /dev/null
+/* PR rtl-optimization/78526 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O -fno-tree-ccp -fno-tree-sra -g -w" } */
+/* { dg-additional-options "-mavx512bw" { target i?86-*-* x86_64-*-* } } */
+
+typedef unsigned U __attribute__ ((vector_size (64)));
+typedef unsigned __int128 V __attribute__ ((vector_size (64)));
+
+static inline V
+bar (U u, U x, V v)
+{
+ v = (V)(U) { 0, ~0 };
+ v[x[0]] <<= u[-63];
+ return v;
+}
+
+V
+foo (U u)
+{
+ return bar (u, (U) {}, (V) {});
+}