+2019-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/90898
+ * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Remove
+ assertion.
+ (insert_clobbers_for_var): Fix a typo in function comment.
+
2019-11-20 Jiangning Liu <jiangning.liu@amperecomputing.com>
Jakub Jelinek <jakub@redhat.com>
--- /dev/null
+/* PR c/90898 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void *p;
+int bar (void);
+void baz (int *);
+
+void
+foo (void)
+{
+ p = __builtin_stack_save ();
+ int a[(bar (), 2)];
+ baz (a);
+ __builtin_stack_restore (p);
+}
else if (gimple_assign_ssa_name_copy_p (stmt))
insert_clobber_before_stack_restore (gimple_assign_lhs (stmt), var,
visited);
- else
- gcc_assert (is_gimple_debug (stmt));
}
/* Advance the iterator to the previous non-debug gimple statement in the same
/* Find a BUILT_IN_STACK_SAVE dominating gsi_stmt (I), and insert
a clobber of VAR before each matching BUILT_IN_STACK_RESTORE.
- It is possible that BUILT_IN_STACK_SAVE cannot be find in a dominator when a
- previous pass (such as DOM) duplicated it along multiple paths to a BB. In
- that case the function gives up without inserting the clobbers. */
+ It is possible that BUILT_IN_STACK_SAVE cannot be found in a dominator when
+ a previous pass (such as DOM) duplicated it along multiple paths to a BB.
+ In that case the function gives up without inserting the clobbers. */
static void
insert_clobbers_for_var (gimple_stmt_iterator i, tree var)