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] [vectorizer] Fix PR tree-optimization/39318


Hi,

When a function call is vectorized, exception handling table should be
updated with a new vector statement, if necessary. Otherwise, there can be
a dead entry in EH table causing verify_stmts failure.

Bootstrapped with vectorization enabled on powerpc64-suse-linux and tested
on x86_64-suse-linux.
O.K. for mainline?

Thanks,
Ira

ChangeLog:

2009-03-02  Richard Guenther  <rguenther@suse.de>
            Ira Rosen  <irar@il.ibm.com>

      PR tree-optimization/39318>
      * tree-vect-transform.c (vectorizable_call): Transfer the EH region
      information to the vectorized statement.

testsuite/ChangeLog:

2009-03-02  Richard Guenther  <rguenther@suse.de>
            Ira Rosen  <irar@il.ibm.com>

      PR tree-optimization/39318
      * gfortran.dg/vect/pr39318.f90: New test.


Index: tree-vect-transform.c
===================================================================
--- tree-vect-transform.c       (revision 144511)
+++ tree-vect-transform.c       (working copy)
@@ -3448,6 +3448,10 @@ vectorizable_call (gimple stmt, gimple_s
       return false;
     }

+  /* Update the exception handling table with the vector stmt if
necessary.  */
+  if (maybe_clean_or_replace_eh_stmt (stmt, *vec_stmt))
+    gimple_purge_dead_eh_edges (gimple_bb (stmt));
+
   VEC_free (tree, heap, vargs);

   /* The call in STMT might prevent it from being removed in dce.
Index: testsuite/gfortran.dg/vect/pr39318.f90
===================================================================
--- testsuite/gfortran.dg/vect/pr39318.f90      (revision 0)
+++ testsuite/gfortran.dg/vect/pr39318.f90      (revision 0)
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! { dg-options "-c -fopenmp -fcray-pointer -fexceptions -O2
-ftree-vectorize" }
+!
+      subroutine adw_trajsp (F_u,i0,in,j0,jn)
+      implicit none
+      real F_u(*)
+      integer i0,in,j0,jn
+      integer n,i,j,
+      real*8 xsin(i0:in,j0:jn)
+!$omp parallel do private(xsin)
+         do j=j0,jn
+         do i=i0,in
+            xsin(i,j) = sqrt(F_u(n))
+         end do
+         end do
+!$omp end parallel do
+      return
+      end
+
+! { 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]