aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-11-20 09:29:35 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-11-20 09:29:35 +0100
commit7313f6cf21109d6cea9f17e749ffbf8fc8d7febc (patch)
tree5078ebfef199e38b4949b64ae537478cd4f5a0a3 /gcc
parent06e8db10cd80d88fb3a6afedf2c35da6c1fa6d85 (diff)
downloadgcc-7313f6cf21109d6cea9f17e749ffbf8fc8d7febc.zip
gcc-7313f6cf21109d6cea9f17e749ffbf8fc8d7febc.tar.gz
gcc-7313f6cf21109d6cea9f17e749ffbf8fc8d7febc.tar.bz2
re PR c/90898 (ICE in insert_clobber_before_stack_restore, at tree-ssa-ccp.c:2112)
PR c/90898 * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Remove assertion. (insert_clobbers_for_var): Fix a typo in function comment. * gcc.dg/pr90898.c: New test. From-SVN: r278481
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.dg/pr90898.c16
-rw-r--r--gcc/tree-ssa-ccp.c8
4 files changed, 29 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 97bc515..1ad5071 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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>
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 920f8eb..004e245 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2019-11-20 Jakub Jelinek <jakub@redhat.com>
+ PR c/90898
+ * gcc.dg/pr90898.c: New test.
+
PR middle-end/91195
* gcc.dg/pr91195.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr90898.c b/gcc/testsuite/gcc.dg/pr90898.c
new file mode 100644
index 0000000..e992ea3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr90898.c
@@ -0,0 +1,16 @@
+/* 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);
+}
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 1e8e472..72e15b1 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2114,8 +2114,6 @@ insert_clobber_before_stack_restore (tree saved_val, tree var,
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
@@ -2140,9 +2138,9 @@ gsi_prev_dom_bb_nondebug (gimple_stmt_iterator *i)
/* 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)