===================================================================
@@ -0,0 +1,28 @@
+/* { 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);
+}
===================================================================
@@ -875,7 +875,7 @@ get_loop_exit_condition (const struct lo
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;
}
===================================================================
@@ -1177,7 +1177,7 @@ canonicalize_loop_induction_variables (s
= niter_desc.may_be_zero && !integer_zerop (niter_desc.may_be_zero);
}
if (TREE_CODE (niter) == INTEGER_CST)
- locus = gimple_location (last_stmt (exit->src));
+ locus = gimple_location_safe (last_stmt (exit->src));
else
{
/* For non-constant niter fold may_be_zero into niter again. */
@@ -1204,7 +1204,7 @@ canonicalize_loop_induction_variables (s
niter = find_loop_niter_by_eval (loop, &exit);
if (exit)
- locus = gimple_location (last_stmt (exit->src));
+ locus = gimple_location_safe (last_stmt (exit->src));
if (TREE_CODE (niter) != INTEGER_CST)
exit = NULL;