re PR tree-optimization/52636 (ICE: tree check: expected integer_cst, have string_cst...
authorRichard Guenther <rguenther@suse.de>
Wed, 21 Mar 2012 08:05:51 +0000 (08:05 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 21 Mar 2012 08:05:51 +0000 (08:05 +0000)
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.

From-SVN: r185599

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

index a1159697da2e7ef02597582d0eda6ee197dd4256..6345f67d2ee89420ed32b4f3a7dd25bd0d5657c6 100644 (file)
@@ -1,3 +1,9 @@
+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)
index dbfe78d9351ccfcddf146138c0104c84080fb34c..c142bbb02014359731c2b56908dbaec2db294ff9 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)