diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-04-13 14:27:52 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-04-13 14:27:52 +0200 |
commit | 37947cd0bdd365cc6d8223d9f81fbfbd3942e50b (patch) | |
tree | 3436f49c14aeb3280e83d1e20dbf698fcf66e1e5 /gcc/gimplify.c | |
parent | 3d3f9e7e6980d6d226b3a11e7ff0256158116b04 (diff) | |
download | gcc-37947cd0bdd365cc6d8223d9f81fbfbd3942e50b.zip gcc-37947cd0bdd365cc6d8223d9f81fbfbd3942e50b.tar.gz gcc-37947cd0bdd365cc6d8223d9f81fbfbd3942e50b.tar.bz2 |
re PR target/70633 (ICE on valid code at -Os (in 32-bit mode) on x86_64-linux-gnu: output_operand: invalid expression as operand)
PR middle-end/70633
* gimplify.c (gimplify_init_constructor): Clear TREE_STATIC if
gimplification turns some element into non-constant.
* gcc.c-torture/compile/pr70633.c: New test.
From-SVN: r234934
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index e49bdaa..99c9760 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4164,7 +4164,7 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, } /* Vector types use CONSTRUCTOR all the way through gimple - compilation as a general initializer. */ + compilation as a general initializer. */ FOR_EACH_VEC_SAFE_ELT (elts, ix, ce) { enum gimplify_status tret; @@ -4172,6 +4172,10 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, fb_rvalue); if (tret == GS_ERROR) ret = GS_ERROR; + else if (TREE_STATIC (ctor) + && !initializer_constant_valid_p (ce->value, + TREE_TYPE (ce->value))) + TREE_STATIC (ctor) = 0; } if (!is_gimple_reg (TREE_OPERAND (*expr_p, 0))) TREE_OPERAND (*expr_p, 1) = get_formal_tmp_var (ctor, pre_p); |