gcc/ChangeLog:
2018-07-13 Kugan Vivekanandarajah <kuganv@linaro.org>
Richard Biener <rguenther@suse.de>
PR middle-end/86489
* tree-ssa-loop-niter.c (number_of_iterations_popcount): Check
that the loop latch destination where phi is defined.
gcc/testsuite/ChangeLog:
2018-07-13 Kugan Vivekanandarajah <kuganv@linaro.org>
PR middle-end/86489
* gcc.dg/pr86489.c: New test.
Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r262622
+2018-07-13 Kugan Vivekanandarajah <kuganv@linaro.org>
+ Richard Biener <rguenther@suse.de>
+
+ PR middle-end/86489
+ * tree-ssa-loop-niter.c (number_of_iterations_popcount): Check
+ that the loop latch destination where phi is defined.
+
2018-07-12 Kito Cheng <kito.cheng@gmail.com>
* config/riscv/riscv.c (enum riscv_privilege_levels): Add UNKNOWN_MODE.
+2018-07-13 Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ PR middle-end/86489
+ * gcc.dg/pr86489.c: New test.
+
2018-07-12 Martin Sebor <msebor@redhat.com>
PR testsuite/86510
--- /dev/null
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int a = 0, b = 0;
+void fn1() {
+ int c = 0;
+ for (; a; a--)
+ c += b;
+ while ((c - 1) & c)
+ ;
+}
... = PHI <b_5(2), b_6(3)>. */
gimple *phi = SSA_NAME_DEF_STMT (b_11);
if (gimple_code (phi) != GIMPLE_PHI
+ || (gimple_bb (phi) != loop_latch_edge (loop)->dest)
|| (gimple_assign_lhs (and_stmt)
!= gimple_phi_arg_def (phi, loop_latch_edge (loop)->dest_idx)))
return false;