diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-11 21:57:52 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-02-11 21:57:52 +0000 |
commit | 2a92826da1414f25df721b4ee71dd5470967c19c (patch) | |
tree | 4a20f063b19d39a1b3b6f180cab2f0a734d92d9c /libgomp | |
parent | 73c5e2aae9a37b711ea6040f36147fbe28798da5 (diff) | |
download | gcc-2a92826da1414f25df721b4ee71dd5470967c19c.tar.gz |
PR middle-end/39154
* gimplify.c (omp_notice_variable): If adding GOVD_SEEN
bit to variable length decl's flags, add it also to its
pointer replacement variable.
* testsuite/libgomp.c/pr39154.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144111 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr39154.c | 105 |
2 files changed, 110 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 1261f3174a4..3d0d3e8ad12 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2009-02-11 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/39154 + * testsuite/libgomp.c/pr39154.c: New test. + 2009-01-30 Ian Lance Taylor <iant@google.com> * acinclude.m4 (LIBCOMP_CHECK_LINKER_FEATURES): Set diff --git a/libgomp/testsuite/libgomp.c/pr39154.c b/libgomp/testsuite/libgomp.c/pr39154.c new file mode 100644 index 00000000000..5a4c89e13eb --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr39154.c @@ -0,0 +1,105 @@ +/* PR middle-end/39154 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -std=gnu99" } */ + +extern void abort (void); + +int n = 20; + +int +main (void) +{ + int a[n], b[n][n]; + +#pragma omp parallel for + for (int i = 0; i < n; i++) + { + a[i] = i + 1; +#pragma omp parallel for + for (int j = 0; j < n; j++) + b[i][j] = a[i]; + } + + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + if (b[i][j] != i + 1) + abort (); + if (a[i] != i + 1) + abort (); + } + +#pragma omp parallel for shared (n, a, b) + for (int i = 0; i < n; i++) + { + a[i] = i + 3; +#pragma omp parallel for + for (int j = 0; j < n; j++) + b[i][j] = a[i]; + } + + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + if (b[i][j] != i + 3) + abort (); + if (a[i] != i + 3) + abort (); + } + +#pragma omp parallel for + for (int i = 0; i < n; i++) + { + a[i] = i + 5; +#pragma omp parallel for shared (n, a, b) + for (int j = 0; j < n; j++) + b[i][j] = a[i]; + } + + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + if (b[i][j] != i + 5) + abort (); + if (a[i] != i + 5) + abort (); + } + +#pragma omp parallel for shared (n, a, b) + for (int i = 0; i < n; i++) + { + a[i] = i + 7; +#pragma omp parallel for shared (n, a, b) + for (int j = 0; j < n; j++) + b[i][j] = a[i]; + } + + for (int i = 0; i < n; i++) + { + for (int j = 0; j < n; j++) + if (b[i][j] != i + 7) + abort (); + if (a[i] != i + 7) + abort (); + } + +#pragma omp parallel for private (a, b) + for (int i = 0; i < n; i++) + { + a[i] = i + 1; +#pragma omp parallel for + for (int j = 0; j < n; j++) + b[i][j] = a[i]; + } + +#pragma omp parallel for private (a, b) + for (int i = 0; i < n; i++) + { + a[i] = i + 1; +#pragma omp parallel for private (b) + for (int j = 0; j < n; j++) + b[i][j] = a[i]; + } + + return 0; +} |