]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/42866 (ICE for REDUCTION with ALLOCATABLE array as variable on SECTIONS)
authorJakub Jelinek <jakub@redhat.com>
Tue, 26 Jan 2010 09:47:45 +0000 (10:47 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 26 Jan 2010 09:47:45 +0000 (10:47 +0100)
PR fortran/42866
* omp-low.c (expand_omp_sections): Only use single_pred if
l2_bb is single_pred_p.

* testsuite/libgomp.fortran/allocatable5.f90: New test.

From-SVN: r156235

gcc/ChangeLog
gcc/omp-low.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.fortran/allocatable5.f90 [new file with mode: 0644]

index ca8d69a9c5c2e3a7b6404b8345ffa0d2bbcf419a..b97384aa2acfdf9b77201f812a026887b84640d9 100644 (file)
@@ -1,3 +1,9 @@
+2010-01-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/42866
+       * omp-low.c (expand_omp_sections): Only use single_pred if
+       l2_bb is single_pred_p.
+
 2010-01-25  Christian Bruel  <christian.bruel@st.com>
 
        PR target/42841
index 317003186d17f50d11a7b69f7edfe89d2cd6d5f3..bb1a86a664897fb6ce3f22f5b3fa0b21b090856e 100644 (file)
@@ -4663,7 +4663,7 @@ expand_omp_sections (struct omp_region *region)
   l2_bb = region->exit;
   if (exit_reachable)
     {
-      if (single_pred (l2_bb) == l0_bb)
+      if (single_pred_p (l2_bb) && single_pred (l2_bb) == l0_bb)
        l2 = gimple_block_label (l2_bb);
       else
        {
index a20b4976aad3ac5aaf68da506066ed51e4547b65..4b20087ff71fc6480ecd60f4788d5364233f8de1 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/42866
+       * testsuite/libgomp.fortran/allocatable5.f90: New test.
+
 2010-01-20  Paolo Bonzini  <bonzini@gnu.org>
 
        * configure.ac: Test for executability of GFORTRAN.
diff --git a/libgomp/testsuite/libgomp.fortran/allocatable5.f90 b/libgomp/testsuite/libgomp.fortran/allocatable5.f90
new file mode 100644 (file)
index 0000000..4180930
--- /dev/null
@@ -0,0 +1,17 @@
+! PR fortran/42866
+! { dg-do run }
+
+program pr42866
+  integer, allocatable :: a(:)
+  allocate (a(16))
+  a = 0
+  !$omp parallel
+    !$omp sections reduction(+:a)
+      a = a + 1
+    !$omp section
+      a = a + 2
+    !$omp end sections
+  !$omp end parallel
+  if (any (a.ne.3)) call abort
+  deallocate (a)
+end