diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-11-22 14:22:51 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-11-22 14:22:51 +0100 |
commit | 29d78eafa6b183b41cd1f4be14dc643c36dc67f0 (patch) | |
tree | 2caae4a138d77eb9fe19bb9fbaa5035930ce4f66 /gcc/expr.c | |
parent | 2dc2114458879e448e4bd43b8593b54f8ce75e55 (diff) | |
download | gcc-29d78eafa6b183b41cd1f4be14dc643c36dc67f0.zip gcc-29d78eafa6b183b41cd1f4be14dc643c36dc67f0.tar.gz gcc-29d78eafa6b183b41cd1f4be14dc643c36dc67f0.tar.bz2 |
expr.c (store_constructor): Allow CONSTRUCTOR with VECTOR_TYPE (same sized) elements even if...
* expr.c (store_constructor): Allow CONSTRUCTOR with VECTOR_TYPE
(same sized) elements even if the type of the CONSTRUCTOR has
vector mode and target is a REG.
From-SVN: r205259
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -6305,6 +6305,18 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) enum machine_mode mode = GET_MODE (target); icode = (int) optab_handler (vec_init_optab, mode); + /* Don't use vec_init<mode> if some elements have VECTOR_TYPE. */ + if (icode != CODE_FOR_nothing) + { + tree value; + + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value) + if (TREE_CODE (TREE_TYPE (value)) == VECTOR_TYPE) + { + icode = CODE_FOR_nothing; + break; + } + } if (icode != CODE_FOR_nothing) { unsigned int i; @@ -6382,8 +6394,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) if (vector) { - /* Vector CONSTRUCTORs should only be built from smaller - vectors in the case of BLKmode vectors. */ + /* vec_init<mode> should not be used if there are VECTOR_TYPE + elements. */ gcc_assert (TREE_CODE (TREE_TYPE (value)) != VECTOR_TYPE); RTVEC_ELT (vector, eltpos) = expand_normal (value); |