From: Jakub Jelinek Date: Thu, 9 Feb 2017 14:26:40 +0000 (+0100) Subject: re PR c/79413 (ICE in make_ssa_name_fn, at tree-ssanames.c:265) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28f6839be16de2fd4143a5395800bb002359b27b;p=gcc.git re PR c/79413 (ICE in make_ssa_name_fn, at tree-ssanames.c:265) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 184e7d1b48e..416961b6321 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2017-02-09 Jakub Jelinek + 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 5d3954496e1..394d385f910 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 8a64e729df7..5ca83f2a759 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2017-02-09 Jakub Jelinek + 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 00000000000..602a974c9be --- /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 (); +}