diff options
author | Richard Sandiford <rsandifo@nildram.co.uk> | 2007-10-29 22:01:24 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-10-29 22:01:24 +0000 |
commit | 9f1da821e6de1d5068d8c03cd46d1b05aab799f1 (patch) | |
tree | 2bff89cfef313ee63b25b7fe75cef5232a452361 /gcc/gimplify.c | |
parent | 5a347f2b406d98c43fc1215af013911d65896c18 (diff) | |
download | gcc-9f1da821e6de1d5068d8c03cd46d1b05aab799f1.zip gcc-9f1da821e6de1d5068d8c03cd46d1b05aab799f1.tar.gz gcc-9f1da821e6de1d5068d8c03cd46d1b05aab799f1.tar.bz2 |
re PR tree-optimization/33614 (ICE on semi-constant vector CONSTRUCTORs)
gcc/
PR tree-optimization/33614
* gimplify.c (gimplify_init_constructor): Gimplify vector constructors
if they can't be reduced to VECTOR_CSTs and aren't legitimate
initializer constants.
gcc/testsuite/
PR tree-optimization/33614
* gcc.c-torture/compile/pr33614.c: New test.
From-SVN: r129739
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 0383377..5c11bad 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3290,8 +3290,9 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p, tree value; /* Even when ctor is constant, it might contain non-*_CST - elements (e.g. { 1.0/0.0 - 1.0/0.0, 0.0 }) and those don't - belong into VECTOR_CST nodes. */ + elements, such as addresses or trapping values like + 1.0/0.0 - 1.0/0.0. Such expressions don't belong + in VECTOR_CST nodes. */ FOR_EACH_CONSTRUCTOR_VALUE (elts, ix, value) if (!CONSTANT_CLASS_P (value)) { @@ -3305,10 +3306,14 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p, break; } - /* Don't reduce a TREE_CONSTANT vector ctor even if we can't + /* Don't reduce an initializer constant even if we can't make a VECTOR_CST. It won't do anything for us, and it'll prevent us from representing it as a single constant. */ - break; + if (initializer_constant_valid_p (ctor, type)) + break; + + TREE_CONSTANT (ctor) = 0; + TREE_INVARIANT (ctor) = 0; } /* Vector types use CONSTRUCTOR all the way through gimple |