re PR tree-optimization/35821 (Internal compiler error: segmentation fault)
authorIra Rosen <irar@il.ibm.com>
Thu, 10 Apr 2008 05:51:59 +0000 (05:51 +0000)
committerIra Rosen <irar@gcc.gnu.org>
Thu, 10 Apr 2008 05:51:59 +0000 (05:51 +0000)
PR tree-optimization/35821
* tree-vect-transform.c (vect_create_data_ref_ptr): Add check that
NEW_STMT_LIST is not NULL.

From-SVN: r134162

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr35821-altivec.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/pr35821-spu.c [new file with mode: 0644]
gcc/tree-vect-transform.c

index ce31ffd6d8764d647c1c27cbe5b5da74ec2bab40..8daa766967912d84b68299e83dc9fa35527982fb 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-10  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/35821
+       * tree-vect-transform.c (vect_create_data_ref_ptr): Add check that
+       NEW_STMT_LIST is not NULL.
+
 2008-04-09  David Edelsohn  <edelsohn@gnu.org>
 
        PR libstdc++/35597
index c82950a3382a34fda77fbe549311fcb01c85366d..1eab06bf7783daef6033d013941aff2063bc5847 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-10  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/35821
+       * gcc.dg/vect/pr35821-altivec.c: New.
+       * gcc.dg/vect/pr35821-spu.c: New.
+
 2008-04-09  Andy Hutchinson  <hutchinsonandy@aim.com>
 
        PR testsuite/34894
diff --git a/gcc/testsuite/gcc.dg/vect/pr35821-altivec.c b/gcc/testsuite/gcc.dg/vect/pr35821-altivec.c
new file mode 100644 (file)
index 0000000..79fa926
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile { target { powerpc_altivec_ok } } } */
+
+#include "altivec.h"
+
+void
+foo (float f_gain1, int n_tail, float * __restrict__ f_in_hptr,
+     float * __restrict__ f_out_hptr)
+{
+  int i;
+  vector float *v_f_in_hptr, *v_f_out_hptr;
+
+  f_in_hptr = ( float* )v_f_in_hptr;
+  f_out_hptr = ( float* )v_f_out_hptr;
+
+  for( i = 0 ; i < n_tail ; i++ ) {
+   f_out_hptr[0] = f_in_hptr[0] * f_gain1;
+   f_in_hptr++;
+   f_out_hptr++;
+  }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/pr35821-spu.c b/gcc/testsuite/gcc.dg/vect/pr35821-spu.c
new file mode 100644 (file)
index 0000000..4cc255f
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do compile { target { spu-*-* } } } */
+
+void
+foo (float f_gain1, int n_tail, float * __restrict__ f_in_hptr,
+     float * __restrict__ f_out_hptr)
+{
+  int i;
+  __attribute__((__spu_vector__)) float *v_f_in_hptr, *v_f_out_hptr;
+
+  f_in_hptr = ( float* )v_f_in_hptr;
+  f_out_hptr = ( float* )v_f_out_hptr;
+
+  for( i = 0 ; i < n_tail ; i++ ) {
+   f_out_hptr[0] = f_in_hptr[0] * f_gain1;
+   f_in_hptr++;
+   f_out_hptr++;
+  }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
index 59fa6d5de8078ffeb6a5d7fd72b451d9d2cb5b4f..6168fdab74d9dfb84c87fd7c5f8145cc0018d455 100644 (file)
@@ -1102,8 +1102,12 @@ vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
   new_temp = vect_create_addr_base_for_vector_ref (stmt, &new_stmt_list,
                                                    offset, loop);
   pe = loop_preheader_edge (loop);
-  new_bb = bsi_insert_on_edge_immediate (pe, new_stmt_list);
-  gcc_assert (!new_bb);
+  if (new_stmt_list)
+    {
+      new_bb = bsi_insert_on_edge_immediate (pe, new_stmt_list);
+      gcc_assert (!new_bb);
+    }
+
   *initial_address = new_temp;
 
   /* Create: p = (vectype *) initial_base  */