2019-03-04 Richard Biener <rguenther@suse.de>
PR middle-end/89572
* tree-scalar-evolution.c: (get_loop_exit_condition): Use
safe_dyn_cast.
* gcc.dg/torture/pr89572.c: New testcase.
From-SVN: r269363
+2019-03-04 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/89572
+ * tree-scalar-evolution.c: (get_loop_exit_condition): Use
+ safe_dyn_cast.
+
2019-03-04 Bin Cheng <bin.cheng@linux.alibaba.com>
PR tree-optimization/89487
+2019-03-04 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/89572
+ * gcc.dg/torture/pr89572.c: New testcase.
+
2018-03-04 Bin Cheng <bin.cheng@linux.alibaba.com>
PR tree-optimization/89487
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-finline-functions" } */
+
+int vh, it, k1;
+
+void
+vn (void)
+{
+ ++vh;
+ if (vh == 0 && it == 0)
+ k1 = -k1;
+}
+
+__attribute__ ((returns_twice)) void
+ef (int *uw)
+{
+ while (uw != (void *) 0)
+ {
+ vn ();
+ *uw = 0;
+ }
+}
+
+void
+gu (int *uw)
+{
+ ef (uw);
+}
gimple *stmt;
stmt = last_stmt (exit_edge->src);
- if (gcond *cond_stmt = dyn_cast <gcond *> (stmt))
+ if (gcond *cond_stmt = safe_dyn_cast <gcond *> (stmt))
res = cond_stmt;
}