aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-07-07 14:49:17 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-07-07 14:49:17 +0200
commit19c44640ebdf27fd4f6a073af4141f2a37283b9b (patch)
tree9739022e90d795baad3ede5dfb7cb3073a4d932d /gcc/gimplify.c
parent4054bc52d6c353aceeb7a9312347c2c98e837783 (diff)
downloadgcc-19c44640ebdf27fd4f6a073af4141f2a37283b9b.zip
gcc-19c44640ebdf27fd4f6a073af4141f2a37283b9b.tar.gz
gcc-19c44640ebdf27fd4f6a073af4141f2a37283b9b.tar.bz2
re PR middle-end/49640 (Internal compiler in C99 code (using variable-length arrays) and OpenMP)
PR middle-end/49640 * gimplify.c (gimplify_compound_lval): For last 2 ARRAY_*REF operands and last COMPONENT_REF operand call gimplify_expr on it if non-NULL. * gcc.dg/gomp/pr49640.c: New test. From-SVN: r175967
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index bc6d321..4ff7e933 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2010,8 +2010,14 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
ret = MIN (ret, tret);
}
}
+ else
+ {
+ tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p, post_p,
+ is_gimple_reg, fb_rvalue);
+ ret = MIN (ret, tret);
+ }
- if (!TREE_OPERAND (t, 3))
+ if (TREE_OPERAND (t, 3) == NULL_TREE)
{
tree elmt_type = TREE_TYPE (TREE_TYPE (TREE_OPERAND (t, 0)));
tree elmt_size = unshare_expr (array_ref_element_size (t));
@@ -2031,11 +2037,17 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
ret = MIN (ret, tret);
}
}
+ else
+ {
+ tret = gimplify_expr (&TREE_OPERAND (t, 3), pre_p, post_p,
+ is_gimple_reg, fb_rvalue);
+ ret = MIN (ret, tret);
+ }
}
else if (TREE_CODE (t) == COMPONENT_REF)
{
/* Set the field offset into T and gimplify it. */
- if (!TREE_OPERAND (t, 2))
+ if (TREE_OPERAND (t, 2) == NULL_TREE)
{
tree offset = unshare_expr (component_ref_field_offset (t));
tree field = TREE_OPERAND (t, 1);
@@ -2054,6 +2066,12 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
ret = MIN (ret, tret);
}
}
+ else
+ {
+ tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p, post_p,
+ is_gimple_reg, fb_rvalue);
+ ret = MIN (ret, tret);
+ }
}
}