aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-06-07 08:36:55 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-06-07 08:36:55 +0200
commit26127932dd7394a8d1cc0c1f55e1de064ba175c0 (patch)
tree89f8ace7255b869a0b352a67d12b9eb752a32289 /libgomp
parentf3dbbfcedf63844e454cdb1d0233934ea0d02507 (diff)
downloadgcc-26127932dd7394a8d1cc0c1f55e1de064ba175c0.zip
gcc-26127932dd7394a8d1cc0c1f55e1de064ba175c0.tar.gz
gcc-26127932dd7394a8d1cc0c1f55e1de064ba175c0.tar.bz2
re PR c/53580 (Internal Segmentation fault in nested "omp parallel", "omp parallel for" and "omp parallel for reduction" Directives)
PR middle-end/53580 * omp-low.c (scan_omp): Change first argument to gimple_seq *, call walk_gimple_seq_mod instead of walk_gimple_seq. (scan_sharing_clauses, scan_omp_parallel, scan_omp_task, scan_omp_for, scan_omp_sections, scan_omp_single, execute_lower_omp): Adjust callers. (scan_omp_1_stmt): Likewise. If check_omp_nesting_restrictions returns false, replace stmt with GIMPLE_NOP. (check_omp_nesting_restrictions): Instead of issuing warnings, issue errors and return false if any errors were reported. * gcc.dg/gomp/nesting-1.c: Expect errors rather than warnings. * gcc.dg/gomp/critical-4.c: Likewise. * gfortran.dg/gomp/appendix-a/a.35.1.f90: Likewise. * gfortran.dg/gomp/appendix-a/a.35.3.f90: Likewise. * gfortran.dg/gomp/appendix-a/a.35.4.f90: Likewise. * gfortran.dg/gomp/appendix-a/a.35.6.f90: Likewise. * c-c++-common/gomp/pr53580.c: New test. * testsuite/libgomp.c/pr26943-2.c: Remove #pragma omp barrier, use GOMP_barrier () call instead. * testsuite/libgomp.c/pr26943-3.c: Likewise. * testsuite/libgomp.c/pr26943-4.c: Likewise. * testsuite/libgomp.fortran/vla4.f90: Remove !$omp barrier, call GOMP_barrier instead. * testsuite/libgomp.fortran/vla5.f90: Likewise. From-SVN: r188298
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog11
-rw-r--r--libgomp/testsuite/libgomp.c/pr26943-2.c5
-rw-r--r--libgomp/testsuite/libgomp.c/pr26943-3.c5
-rw-r--r--libgomp/testsuite/libgomp.c/pr26943-4.c5
-rw-r--r--libgomp/testsuite/libgomp.fortran/vla4.f906
-rw-r--r--libgomp/testsuite/libgomp.fortran/vla5.f906
6 files changed, 30 insertions, 8 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index f22c41a..df2bfb5 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,14 @@
+2012-06-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/53580
+ * testsuite/libgomp.c/pr26943-2.c: Remove #pragma omp barrier,
+ use GOMP_barrier () call instead.
+ * testsuite/libgomp.c/pr26943-3.c: Likewise.
+ * testsuite/libgomp.c/pr26943-4.c: Likewise.
+ * testsuite/libgomp.fortran/vla4.f90: Remove !$omp barrier,
+ call GOMP_barrier instead.
+ * testsuite/libgomp.fortran/vla5.f90: Likewise.
+
2012-06-06 Jakub Jelinek <jakub@redhat.com>
PR libgomp/52993
diff --git a/libgomp/testsuite/libgomp.c/pr26943-2.c b/libgomp/testsuite/libgomp.c/pr26943-2.c
index c052e81..2ed21ae 100644
--- a/libgomp/testsuite/libgomp.c/pr26943-2.c
+++ b/libgomp/testsuite/libgomp.c/pr26943-2.c
@@ -3,6 +3,7 @@
extern int omp_set_dynamic (int);
extern void abort (void);
+extern void GOMP_barrier (void);
int a = 8, b = 12, c = 16, d = 20, j = 0;
char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d";
@@ -20,7 +21,7 @@ main (void)
{
if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b')
j++;
-#pragma omp barrier /* { dg-warning "may not be closely nested" } */
+ GOMP_barrier ();
#pragma omp atomic
a += i;
b += i;
@@ -31,7 +32,7 @@ main (void)
f[0] += i;
g[0] = 'g' + i;
h[0] = 'h' + i;
-#pragma omp barrier /* { dg-warning "may not be closely nested" } */
+ GOMP_barrier ();
if (a != 8 + 6 || b != 12 + i || c != i || d != i)
j += 8;
if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i)
diff --git a/libgomp/testsuite/libgomp.c/pr26943-3.c b/libgomp/testsuite/libgomp.c/pr26943-3.c
index dc3d501..855a4b2 100644
--- a/libgomp/testsuite/libgomp.c/pr26943-3.c
+++ b/libgomp/testsuite/libgomp.c/pr26943-3.c
@@ -4,6 +4,7 @@
extern int omp_set_dynamic (int);
extern int omp_get_thread_num (void);
extern void abort (void);
+extern void GOMP_barrier (void);
int a = 8, b = 12, c = 16, d = 20, j = 0, l = 0;
char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d";
@@ -26,7 +27,7 @@ main (void)
{
if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b')
j++;
-#pragma omp barrier /* { dg-warning "may not be closely nested" } */
+ GOMP_barrier ();
#pragma omp atomic
a += i;
b += i;
@@ -37,7 +38,7 @@ main (void)
f[0] += i;
g[0] = 'g' + i;
h[0] = 'h' + i;
-#pragma omp barrier /* { dg-warning "may not be closely nested" } */
+ GOMP_barrier ();
if (a != 8 + 6 || b != 12 + i || c != i || d != i)
j += 8;
if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i)
diff --git a/libgomp/testsuite/libgomp.c/pr26943-4.c b/libgomp/testsuite/libgomp.c/pr26943-4.c
index 0f1d419..24f253d 100644
--- a/libgomp/testsuite/libgomp.c/pr26943-4.c
+++ b/libgomp/testsuite/libgomp.c/pr26943-4.c
@@ -4,6 +4,7 @@
extern int omp_set_dynamic (int);
extern int omp_get_thread_num (void);
extern void abort (void);
+extern void GOMP_barrier (void);
int a = 8, b = 12, c = 16, d = 20, j = 0, l = 0;
char e[10] = "a", f[10] = "b", g[10] = "c", h[10] = "d";
@@ -27,7 +28,7 @@ main (void)
{
if (a != 8 || b != 12 || e[0] != 'a' || f[0] != 'b')
j++;
-#pragma omp barrier /* { dg-warning "may not be closely nested" } */
+ GOMP_barrier ();
#pragma omp atomic
a += i;
b += i;
@@ -38,7 +39,7 @@ main (void)
f[0] += i;
g[0] = 'g' + i;
h[0] = 'h' + i;
-#pragma omp barrier /* { dg-warning "may not be closely nested" } */
+ GOMP_barrier ();
if (a != 8 + 6 || b != 12 + i || c != i || d != i)
j += 8;
if (e[0] != 'a' + 6 || f[0] != 'b' + i || g[0] != 'g' + i)
diff --git a/libgomp/testsuite/libgomp.fortran/vla4.f90 b/libgomp/testsuite/libgomp.fortran/vla4.f90
index cdd4849..0bee30c 100644
--- a/libgomp/testsuite/libgomp.fortran/vla4.f90
+++ b/libgomp/testsuite/libgomp.fortran/vla4.f90
@@ -10,6 +10,10 @@ contains
subroutine foo (c, d, e, f, g, h, i, j, k, n)
use omp_lib
+ interface
+ subroutine GOMP_barrier () bind(c, name="GOMP_barrier")
+ end subroutine
+ end interface
integer :: n
character (len = *) :: c
character (len = n) :: d
@@ -94,7 +98,7 @@ contains
forall (p = 1:2, q = 3:7, r = 1:7) u(p, q, r) = 30 - x - p + q - 2 * r
forall (p = 1:5, q = 3:7, p + q .le. 8) v(p, q) = w(1:7)
forall (p = 1:5, q = 3:7, p + q .gt. 8) v(p, q) = w(20:26)
-!$omp barrier ! { dg-warning "may not be closely nested" }
+ call GOMP_barrier
y = ''
if (x .eq. 0) y = '0'
if (x .eq. 1) y = '1'
diff --git a/libgomp/testsuite/libgomp.fortran/vla5.f90 b/libgomp/testsuite/libgomp.fortran/vla5.f90
index 9b61150..cdd561d 100644
--- a/libgomp/testsuite/libgomp.fortran/vla5.f90
+++ b/libgomp/testsuite/libgomp.fortran/vla5.f90
@@ -10,6 +10,10 @@ contains
subroutine foo (c, d, e, f, g, h, i, j, k, n)
use omp_lib
+ interface
+ subroutine GOMP_barrier () bind(c, name="GOMP_barrier")
+ end subroutine
+ end interface
integer :: n
character (len = *) :: c
character (len = n) :: d
@@ -66,7 +70,7 @@ contains
forall (p = 1:2, q = 3:7, r = 1:7) u(p, q, r) = 30 - x - p + q - 2 * r
forall (p = 1:5, q = 3:7, p + q .le. 8) v(p, q) = w(1:7)
forall (p = 1:5, q = 3:7, p + q .gt. 8) v(p, q) = w(20:26)
-!$omp barrier ! { dg-warning "may not be closely nested" }
+ call GOMP_barrier
y = ''
if (x .eq. 0) y = '0'
if (x .eq. 1) y = '1'