+2014-06-18 Yuri Rumyantsev <ysrumyan@gmail.com>
+
+ PR tree-optimization/61518
+ * tree-if-conv.c (is_cond_scalar_reduction): Add missed check that
+ reduction var is used in reduction stmt or phi-function only.
+
2014-06-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm_neon.h (vadd_f32): Change #ifdef to __FAST_MATH.
+2014-06-18 Yuri Rumyantsev <ysrumyan@gmail.com>
+
+ PR tree-optimization/61518
+ * gcc.dg/torture/pr61518.c: New test.
+
2014-06-18 Thomas Preud'homme <thomas.preudhomme@arm.com>
PR tree-optimization/61517
--- /dev/null
+/* { dg-do run } */
+
+int a, b, c[1], d, e, f;
+
+void
+fn1 ()
+{
+ for (; d < 1; d++)
+ {
+ if (b)
+ {
+ a = e++ && f;
+ b = f;
+ }
+ c[b] = 0;
+ }
+}
+
+int
+main ()
+{
+ fn1 ();
+
+ if (e != 0)
+ __builtin_abort ();
+
+ return 0;
+}
+
enum tree_code reduction_op;
struct loop *loop = gimple_bb (phi)->loop_father;
edge latch_e = loop_latch_edge (loop);
+ imm_use_iterator imm_iter;
+ use_operand_p use_p;
arg_0 = PHI_ARG_DEF (phi, 0);
arg_1 = PHI_ARG_DEF (phi, 1);
else if (r_op1 != PHI_RESULT (header_phi))
return false;
+ /* Check that R_OP1 is used in reduction stmt or in PHI only. */
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, r_op1)
+ {
+ gimple use_stmt = USE_STMT (use_p);
+ if (is_gimple_debug (use_stmt))
+ continue;
+ if (use_stmt == stmt)
+ continue;
+ if (gimple_code (use_stmt) != GIMPLE_PHI)
+ return false;
+ }
+
*op0 = r_op1; *op1 = r_op2;
*reduc = stmt;
return true;