aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/gimplify.h2
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr79413.c13
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 184e7d1..416961b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2017-02-09 Jakub Jelinek <jakub@redhat.com>
+ PR c/79413
+ * gimplify.h (is_gimple_sizepos): Only test for INTEGER_CST constants,
+ not arbitrary TREE_CONSTANT.
+
PR c/79431
* gimplify.c (gimplify_adjust_omp_clauses): Ignore
"omp declare target link" attribute unless is_global_var.
diff --git a/gcc/gimplify.h b/gcc/gimplify.h
index 5d39544..394d385 100644
--- a/gcc/gimplify.h
+++ b/gcc/gimplify.h
@@ -99,7 +99,7 @@ is_gimple_sizepos (tree expr)
but that will cause problems if this type is from outside the function.
It's OK to have that here. */
return (expr == NULL_TREE
- || TREE_CONSTANT (expr)
+ || TREE_CODE (expr) == INTEGER_CST
|| TREE_CODE (expr) == VAR_DECL
|| CONTAINS_PLACEHOLDER_P (expr));
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8a64e72..5ca83f2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2017-02-09 Jakub Jelinek <jakub@redhat.com>
+ PR c/79413
+ * gcc.c-torture/compile/pr79413.c: New test.
+
PR c++/79429
* c-c++-common/gomp/pr79429.c: New test.
* g++.dg/gomp/pr79429.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr79413.c b/gcc/testsuite/gcc.c-torture/compile/pr79413.c
new file mode 100644
index 0000000..602a974
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr79413.c
@@ -0,0 +1,13 @@
+/* PR c/79413 */
+
+void
+foo ()
+{
+ int a[1/0];
+}
+
+void
+bar (void)
+{
+ foo ();
+}