On 4/24/07, Mark Mitchell <[EMAIL PROTECTED]> wrote:
2. PR 30222: crash on gcc.target/i386/vectorize1.c

This PR is apparently due to only part of a mainline patch being applied
to 4.2.  It was so diagnosed in December 2006, but nobody has identified
the missing part of the mainline patch.  Andrew, as you've diagnosed the
problem, would you please identify the solution?

This is what I am checking in to the 4.2 branch.  I bootstrapped and
tested on x86-linux-gnu with no regressions and fixes the testcase.
This is a back port of part of:
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg00702.html
Which was also part of the orginal patch which was supposed to fix this patch:
http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00566.html.

Thanks,
Andrew Pinski

2007-04-24  Andrew Pinski  <[EMAIL PROTECTED]>
           Roger Sayle  <[EMAIL PROTECTED]>

       PR middle-end/30222
       * expmed.c (make_tree): Use the correct type, i.e. the inner
       type, when constructing the individual elements of a CONST_VECTOR.
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 124139)
+++ ChangeLog   (working copy)
@@ -1,3 +1,10 @@
+2007-04-24  Andrew Pinski  <[EMAIL PROTECTED]>
+            Roger Sayle  <[EMAIL PROTECTED]>
+
+       PR middle-end/30222
+       * expmed.c (make_tree): Use the correct type, i.e. the inner
+       type, when constructing the individual elements of a CONST_VECTOR.
+
 2007-04-24  Ian Lance Taylor  <[EMAIL PROTECTED]>
 
        PR tree-optimization/31605
Index: expmed.c
===================================================================
--- expmed.c    (revision 124139)
+++ expmed.c    (working copy)
@@ -4976,17 +4976,17 @@ make_tree (tree type, rtx x)
 
     case CONST_VECTOR:
       {
-       int i, units;
-       rtx elt;
+       int units = CONST_VECTOR_NUNITS (x);
+       tree itype = TREE_TYPE (type);
        tree t = NULL_TREE;
+       int i;
 
-       units = CONST_VECTOR_NUNITS (x);
 
        /* Build a tree with vector elements.  */
        for (i = units - 1; i >= 0; --i)
          {
-           elt = CONST_VECTOR_ELT (x, i);
-           t = tree_cons (NULL_TREE, make_tree (type, elt), t);
+           rtx elt = CONST_VECTOR_ELT (x, i);
+           t = tree_cons (NULL_TREE, make_tree (itype, elt), t);
          }
 
        return build_vector (type, t);

Reply via email to