+2016-04-05 Zdenek Sojka <zsojka@seznam.cz>
+
+ PR tree-optimization/70509
+ * tree-ssa-forwprop.c (simplify_bitfield_ref): Use bitsize_int instead
+ of the vector base type for index.
+
2016-04-05 Uros Bizjak <ubizjak@gmail.com>
PR target/70510
+2016-04-05 Zdenek Sojka <zsojka@seznam.cz>
+
+ PR tree-optimization/70509
+ * gcc.target/i386/avx512bw-pr70509.c: New test.
+
2016-04-05 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/70452
--- /dev/null
+/* PR tree-optimization/70509 */
+/* { dg-do run } */
+/* { dg-options "-O1 -mavx512bw" } */
+/* { dg-require-effective-target avx512bw } */
+
+#define AVX512BW
+#include "avx512f-helper.h"
+
+typedef char V __attribute__ ((vector_size (64)));
+
+int __attribute__ ((noinline, noclone))
+foo (V u, V v)
+{
+ u /= v[0x20];
+ return u[0];
+}
+
+void
+TEST (void)
+{
+ int x = foo ((V) { 9 }, (V) { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3 });
+ if (x != 3)
+ abort ();
+}
if (code == VEC_PERM_EXPR)
{
- tree p, m, index, tem;
+ tree p, m, tem;
unsigned nelts;
m = gimple_assign_rhs3 (def_stmt);
if (TREE_CODE (m) != VECTOR_CST)
p = gimple_assign_rhs2 (def_stmt);
idx -= nelts;
}
- index = build_int_cst (TREE_TYPE (TREE_TYPE (m)), idx * size);
tem = build3 (BIT_FIELD_REF, TREE_TYPE (op),
- unshare_expr (p), op1, index);
+ unshare_expr (p), op1, bitsize_int (idx * size));
gimple_assign_set_rhs1 (stmt, tem);
fold_stmt (gsi);
update_stmt (gsi_stmt (*gsi));