+2018-01-16 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/83867
+ * tree-vect-stmts.c (vect_transform_stmt): Precompute
+ nested_in_vect_loop_p since the scalar stmt may get invalidated.
+
2018-01-16 Jakub Jelinek <jakub@redhat.com>
PR c/83844
+2018-01-16 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/83867
+ * gcc.dg/vect/pr83867.c: New testcase.
+
2018-01-16 Jakub Jelinek <jakub@redhat.com>
PR c/83844
gcc_assert (slp_node || !PURE_SLP_STMT (stmt_info));
gimple *old_vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
+ bool nested_p = (STMT_VINFO_LOOP_VINFO (stmt_info)
+ && nested_in_vect_loop_p
+ (LOOP_VINFO_LOOP (STMT_VINFO_LOOP_VINFO (stmt_info)),
+ stmt));
+
switch (STMT_VINFO_TYPE (stmt_info))
{
case type_demotion_vec_info_type:
/* Handle inner-loop stmts whose DEF is used in the loop-nest that
is being vectorized, but outside the immediately enclosing loop. */
if (vec_stmt
- && STMT_VINFO_LOOP_VINFO (stmt_info)
- && nested_in_vect_loop_p (LOOP_VINFO_LOOP (
- STMT_VINFO_LOOP_VINFO (stmt_info)), stmt)
+ && nested_p
&& STMT_VINFO_TYPE (stmt_info) != reduc_vec_info_type
&& (STMT_VINFO_RELEVANT (stmt_info) == vect_used_in_outer
|| STMT_VINFO_RELEVANT (stmt_info) ==