diff options
author | Joseph Myers <joseph@codesourcery.com> | 2006-08-26 00:01:16 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2006-08-26 00:01:16 +0100 |
commit | 4c923c28479a212d59b96928006b6464509d918b (patch) | |
tree | 6486b3e2d432444b8f03be5770b966b4e48e6344 /gcc/gimplify.c | |
parent | 459881189a60e313cbd9e35e415b7cc794289149 (diff) | |
download | gcc-4c923c28479a212d59b96928006b6464509d918b.zip gcc-4c923c28479a212d59b96928006b6464509d918b.tar.gz gcc-4c923c28479a212d59b96928006b6464509d918b.tar.bz2 |
re PR c/27893 (ICE with TREE_CONSTANT VLA sizes inside functions)
PR c/27893
* gimplify.c (gimplify_decl_expr, gimplify_init_ctor_preeval,
omp_add_variable): Treat sizes as variable whenever not
INTEGER_CST.
testsuite:
* gcc.c-torture/compile/vla-const-1.c,
gcc.c-torture/compile/vla-const-2.c: New tests.
From-SVN: r116450
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index fd9e1e5..cf48770 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1219,7 +1219,7 @@ gimplify_decl_expr (tree *stmt_p) { tree init = DECL_INITIAL (decl); - if (!TREE_CONSTANT (DECL_SIZE (decl))) + if (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) { /* This is a variable-sized decl. Simplify its size and mark it for deferred expansion. Note that mudflap depends on the format @@ -2696,7 +2696,7 @@ gimplify_init_ctor_preeval (tree *expr_p, tree *pre_p, tree *post_p, /* If this is of variable size, we have no choice but to assume it doesn't overlap since we can't make a temporary for it. */ - if (!TREE_CONSTANT (TYPE_SIZE (TREE_TYPE (*expr_p)))) + if (TREE_CODE (TYPE_SIZE (TREE_TYPE (*expr_p))) != INTEGER_CST) return; /* Otherwise, we must search for overlap ... */ @@ -4384,7 +4384,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags) /* When adding a variable-sized variable, we have to handle all sorts of additional bits of data: the pointer replacement variable, and the parameters of the type. */ - if (DECL_SIZE (decl) && !TREE_CONSTANT (DECL_SIZE (decl))) + if (DECL_SIZE (decl) && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST) { /* Add the pointer replacement variable as PRIVATE if the variable replacement is private, else FIRSTPRIVATE since we'll need the @@ -4431,7 +4431,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags) if ((flags & GOVD_SHARED) == 0) { t = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl))); - if (!TREE_CONSTANT (t)) + if (TREE_CODE (t) != INTEGER_CST) omp_notice_variable (ctx, t, true); } } |