]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.c (store_constructor): Allow CONSTRUCTOR with VECTOR_TYPE (same sized) elements...
authorJakub Jelinek <jakub@redhat.com>
Fri, 22 Nov 2013 13:22:51 +0000 (14:22 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 22 Nov 2013 13:22:51 +0000 (14:22 +0100)
* 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

gcc/ChangeLog
gcc/expr.c

index d04b496e235d6a04d0f9d2c98700a7642edbade2..d1b3d54d70e55a24f33aa1930ffd80510591b88f 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-22  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2013-11-22  Richard Biener  <rguenther@suse.de>
 
        Revert
index 968438b2fbac32438114556331bcbc03fa54c4e1..6cbd7a95bbc43b8ed2b587077cdf56231fe87198 100644 (file)
@@ -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);