re PR tree-optimization/36293 (ICE or wrong code in vector-strided gap tests)
authorIra Rosen <irar@il.ibm.com>
Thu, 22 May 2008 10:39:44 +0000 (10:39 +0000)
committerIra Rosen <irar@gcc.gnu.org>
Thu, 22 May 2008 10:39:44 +0000 (10:39 +0000)
PR tree-optimization/36293
* tree-vect-transform.c (vect_transform_strided_load): Don't check
if the first load must be skipped because of a gap.

From-SVN: r135755

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

index 4f2d4c42f81e1bf83aa758749ff75d285abe372e..eda2ea21c1cb42c324b5519540629166bcc2a5a0 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-22  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/36293
+       * tree-vect-transform.c (vect_transform_strided_load): Don't check
+       if the first load must be skipped because of a gap.
+
 2008-05-22  Richard Guenther  <rguenther@suse.de>
 
        * tree-dfa.c (refs_may_alias_p): Exit early if possible.  Handle
index 82a4c84893a80ee3f459f669d75e0268fdb86ae1..1f6a13b7bccf271798a2e81eb3bfa478874f83c5 100644 (file)
@@ -5473,12 +5473,14 @@ vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size,
        break;
 
       /* Skip the gaps. Loads created for the gaps will be removed by dead
-       code elimination pass later.
+       code elimination pass later. No need to check for the first stmt in
+       the group, since it always exists.
        DR_GROUP_GAP is the number of steps in elements from the previous
        access (if there is no gap DR_GROUP_GAP is 1). We skip loads that
        correspond to the gaps.
       */
-      if (gap_count < DR_GROUP_GAP (vinfo_for_stmt (next_stmt)))
+      if (next_stmt != first_stmt 
+          && gap_count < DR_GROUP_GAP (vinfo_for_stmt (next_stmt)))
       {
         gap_count++;
         continue;