re PR c/79413 (ICE in make_ssa_name_fn, at tree-ssanames.c:265)
authorJakub Jelinek <jakub@redhat.com>
Thu, 9 Feb 2017 14:26:40 +0000 (15:26 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 9 Feb 2017 14:26:40 +0000 (15:26 +0100)
PR c/79413
* gimplify.h (is_gimple_sizepos): Only test for INTEGER_CST constants,
not arbitrary TREE_CONSTANT.

* gcc.c-torture/compile/pr79413.c: New test.

From-SVN: r245304

gcc/ChangeLog
gcc/gimplify.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr79413.c [new file with mode: 0644]

index 184e7d1b48ec33681140a6fc36e4bbce5b05e251..416961b632113ffa677450e1a79ebc529f16aee9 100644 (file)
@@ -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.
index 5d3954496e1389504a1591c68e4c50a369f7a1b4..394d385f910911971e3cfe78c1c53359684e203c 100644 (file)
@@ -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));
 }                                        
index 8a64e729df7245483522154af7d4a0acda319fb3..5ca83f2a759bc71ddfdf3e3abcd89a8693581b6c 100644 (file)
@@ -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 (file)
index 0000000..602a974
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR c/79413 */
+
+void
+foo ()
+{
+  int a[1/0];
+}
+
+void
+bar (void)
+{
+  foo ();
+}