===================================================================
@@ -910,7 +910,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;
}
===================================================================
@@ -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);
+}