[Bug tree-optimization/52636] [4.8 Regression] ICE: tree check: expected integer_cst, have string_cst in tree_to_double_int, at tree.h:4324

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 20 15:59:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52636

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |tree-optimization

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-03-20 15:56:42 UTC ---
Patch:

2012-03-20  Richard Guenther  <rguenther@suse.de>

        PR tree-optimizer/52636
        * tree-vect-slp.c (vect_get_constant_vectors): Convert constants
        to the appropriate type.

Index: gcc/tree-vect-slp.c
===================================================================
*** gcc/tree-vect-slp.c (revision 185563)
--- gcc/tree-vect-slp.c (working copy)
*************** vect_get_constant_vectors (tree op, slp_
*** 2363,2368 ****
--- 2363,2374 ----

            /* 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)



More information about the Gcc-bugs mailing list