summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-01-16 16:18:24 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-01-16 16:18:24 +0100
commit47c268c4b27782717fbccec5019e0cd97d005afb (patch)
tree5c745cb7d58bf3c4f7d5f54233cd961caf3125d2 /gcc/gimplify.c
parentfb2f98bb6c5e016514bc3b93f8f1550e39e7d28f (diff)
downloadgcc-47c268c4b27782717fbccec5019e0cd97d005afb.tar.gz
re PR libgomp/83590 ([nvptx] openacc reduction C regressions)
PR libgomp/83590 * gimplify.c (gimplify_one_sizepos): For is_gimple_constant (expr) return early, inline manually is_gimple_sizepos. Make sure if we call gimplify_expr we don't end up with a gimple constant. * tree.c (variably_modified_type_p): Don't return true for is_gimple_constant (_t). Inline manually is_gimple_sizepos. * gimplify.h (is_gimple_sizepos): Remove. Co-Authored-By: Richard Biener <rguenther@suse.de> From-SVN: r256748
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index fd0d21ebe4d..8e86c338fc1 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -12562,7 +12562,10 @@ gimplify_one_sizepos (tree *expr_p, gimple_seq *stmt_p)
a VAR_DECL. If it's a VAR_DECL from another function, the gimplifier
will want to replace it with a new variable, but that will cause problems
if this type is from outside the function. It's OK to have that here. */
- if (is_gimple_sizepos (expr))
+ if (expr == NULL_TREE
+ || is_gimple_constant (expr)
+ || TREE_CODE (expr) == VAR_DECL
+ || CONTAINS_PLACEHOLDER_P (expr))
return;
*expr_p = unshare_expr (expr);
@@ -12570,6 +12573,12 @@ gimplify_one_sizepos (tree *expr_p, gimple_seq *stmt_p)
/* SSA names in decl/type fields are a bad idea - they'll get reclaimed
if the def vanishes. */
gimplify_expr (expr_p, stmt_p, NULL, is_gimple_val, fb_rvalue, false);
+
+ /* If expr wasn't already is_gimple_sizepos or is_gimple_constant from the
+ FE, ensure that it is a VAR_DECL, otherwise we might handle some decls
+ as gimplify_vla_decl even when they would have all sizes INTEGER_CSTs. */
+ if (is_gimple_constant (*expr_p))
+ *expr_p = get_initialized_tmp_var (*expr_p, stmt_p, NULL, false);
}
/* Gimplify the body of statements of FNDECL and return a GIMPLE_BIND node