This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix PR tree-optimization/40238 and testsuite failures caused by SLP


Hi,

This patch fixes two bugs in basic block SLP implementation. It adds the
forgotten free of basic block vectorization data structure, and changes the
place of insertion of new statements to after the labels.

The patch fixes PR tree-optimization/40238 and the testsuite failures
reported by Richard
(http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01552.html).

Bootstrapped with vectorization enabled on powerpc64-suse-linux and tested
without regressions on x86_64-suse-linux.
Committed revision 147844.

Ira

ChangeLog:

      PR tree-optimization/40238
      * tree-vect-stmts.c (vect_init_vector): Insert initialization
      statements after basic block's labels.
      * tree-vect-slp.c (vect_slp_transform_bb): Call destroy_bb_vec_info()
      to free the allocated memory.

testsuite/ChangeLog:

      PR tree-optimization/40238
      * gcc.dg/vect/pr40238.c: New test.


Index: tree-vect-stmts.c
===================================================================
--- tree-vect-stmts.c   (revision 147843)
+++ tree-vect-stmts.c   (working copy)
@@ -833,7 +833,7 @@ vect_init_vector (gimple stmt, tree vect

           gcc_assert (bb_vinfo);
           bb = BB_VINFO_BB (bb_vinfo);
-          gsi_bb_start = gsi_start_bb (bb);
+          gsi_bb_start = gsi_after_labels (bb);
           gsi_insert_before (&gsi_bb_start, init_stmt, GSI_SAME_STMT);
        }
     }
Index: tree-vect-slp.c
===================================================================
--- tree-vect-slp.c     (revision 147843)
+++ tree-vect-slp.c     (working copy)
@@ -2089,6 +2089,7 @@ vect_slp_transform_bb (basic_block bb)

   if (vect_print_dump_info (REPORT_DETAILS))
     fprintf (vect_dump, "BB VECTORIZED\n");
-}

+  destroy_bb_vec_info (bb_vinfo);
+}
Index: testsuite/gcc.dg/vect/pr40238.c
===================================================================
--- testsuite/gcc.dg/vect/pr40238.c     (revision 0)
+++ testsuite/gcc.dg/vect/pr40238.c     (revision 0)
@@ -0,0 +1,35 @@
+/* { dg-do compile } */
+
+extern int xdo_rb_ctr_row( int *pos_code);
+
+int xgp_ahd_interpolate (int tile)
+{
+ int p[4];
+
+ switch (tile) {
+ default:
+ case 0:
+ case 1:
+  p[0] = 0; p[1] = 1; p[2] = 2; p[3] = 3;
+  break;
+ case 2:
+ case 3:
+  p[0] = 1; p[1] = 0; p[2] = 3; p[3] = 2;
+  break;
+ case 4:
+ case 5:
+  p[0] = 3; p[1] = 2; p[2] = 1; p[3] = 0;
+  break;
+ case 6:
+ case 7:
+  p[0] = 2; p[1] = 3; p[2] = 0; p[3] = 1;
+  break;
+ }
+
+ xdo_rb_ctr_row(p);
+ xdo_rb_ctr_row(p);
+ return 0;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
+


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]