From 57b5438ac697cd364455365a6f060fbbac0b1111 Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 22 Nov 2013 13:22:51 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205259 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/expr.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'gcc/expr.c') diff --git a/gcc/expr.c b/gcc/expr.c index 968438b2fba..6cbd7a95bbc 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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 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 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); -- cgit v1.2.1