aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-06-14 19:48:38 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-06-14 19:48:38 +0200
commitf5d2ddbd0fc18ebb199680248bc9d82a929179ff (patch)
treed35512bb213148d0fc2fb989c4f5079c588f8957 /libgomp
parent91816631541b56f2b26fea94e0d316a89b0957be (diff)
backport: re PR c/53580 (Internal Segmentation fault in nested "omp parallel", "omp parallel for" and "omp parallel for reduction" Directives)
Backported from mainline 2012-06-07 Jakub Jelinek <jakub@redhat.com> PR middle-end/53580 * omp-low.c (scan_omp_1_stmt): 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: r188625
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 fc70728ec4b..0edfe264c85 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,6 +1,17 @@
2012-06-14 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 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 c052e811288..2ed21ae963e 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 dc3d5010da1..855a4b27446 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 0f1d4197a5f..24f253d236d 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 cdd4849b6ad..0bee30cf817 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 9b611505219..cdd561d3961 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'