2012-03-21 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Mar 2012 08:05:51 +0000 (08:05 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Mar 2012 08:05:51 +0000 (08:05 +0000)
PR tree-optimizer/52636
* tree-vect-slp.c (vect_get_constant_vectors): Convert constants
to the appropriate type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185599 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-vect-slp.c

index a115969..6345f67 100644 (file)
@@ -1,5 +1,11 @@
 2012-03-21  Richard Guenther  <rguenther@suse.de>
 
+       PR tree-optimizer/52636
+       * tree-vect-slp.c (vect_get_constant_vectors): Convert constants
+       to the appropriate type.
+
+2012-03-21  Richard Guenther  <rguenther@suse.de>
+
        * Makefile.in (cfgexpand.o): Add $(REGS_H) and $(INTEGRATE_H)
        dependencies.
        * cfgexpand.c (gimple_expand_cfg): Fold in pass_init_function,
index dbfe78d..c142bbb 100644 (file)
@@ -2363,6 +2363,12 @@ vect_get_constant_vectors (tree op, slp_tree slp_node,
 
           /* Create 'vect_ = {op0,op1,...,opn}'.  */
           number_of_places_left_in_vector--;
+         if (constant_p
+             && !types_compatible_p (TREE_TYPE (vector_type), TREE_TYPE (op)))
+           {
+             op = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (vector_type), op);
+             gcc_assert (op && CONSTANT_CLASS_P (op));
+           }
          elts[number_of_places_left_in_vector] = op;
 
           if (number_of_places_left_in_vector == 0)