diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-02-15 18:42:25 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-02-15 18:42:25 +0100 |
commit | ac84c0623d12bb99990f34f6bfdf0b17ab976ad6 (patch) | |
tree | 00838c45dda5e882688c9dd4d4b72503f4c309c9 /libgomp | |
parent | 6a9e85714c092d145293dbb71a748a8ab7b19961 (diff) | |
download | gcc-ac84c0623d12bb99990f34f6bfdf0b17ab976ad6.zip gcc-ac84c0623d12bb99990f34f6bfdf0b17ab976ad6.tar.gz gcc-ac84c0623d12bb99990f34f6bfdf0b17ab976ad6.tar.bz2 |
re PR middle-end/35196 (lastprivate broken for static non-ordered loops)
PR middle-end/35196
* omp-low.c (expand_omp_for_generic): Don't initialize fd->v
in entry_bb.
(expand_omp_for_static_nochunk): Initialize fd->v in seq_start_bb
rather than in entry_bb.
* testsuite/libgomp.c/pr35196.c: New test.
From-SVN: r132351
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 3 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr35196.c | 43 |
2 files changed, 46 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 6a8ba53..44286ca 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,5 +1,8 @@ 2008-02-15 Jakub Jelinek <jakub@redhat.com> + PR middle-end/35196 + * testsuite/libgomp.c/pr35196.c: New test. + PR middle-end/35130 * testsuite/libgomp.fortran/pr35130.f90: New test. * testsuite/libgomp.c/pr35130.c: New test. diff --git a/libgomp/testsuite/libgomp.c/pr35196.c b/libgomp/testsuite/libgomp.c/pr35196.c new file mode 100644 index 0000000..e92d976 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr35196.c @@ -0,0 +1,43 @@ +/* PR middle-end/35196 */ +/* { dg-do run } */ + +extern void abort (void); +extern void omp_set_dynamic (int); + +int +main (void) +{ + int i, j; + omp_set_dynamic (0); +#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static) + for (i = 0; i < 5; i++) + j = i; + if (i != 5 || j != 4) + abort (); +#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static, 2) + for (i = 0; i < 5; i++) + j = i; + if (i != 5 || j != 4) + abort (); +#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (dynamic) + for (i = 0; i < 5; i++) + j = i; + if (i != 5 || j != 4) + abort (); +#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static) + for (i = -12; i < 21; i += 3) + j = i; + if (i != 21 || j != 18) + abort (); +#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (static, 2) + for (i = -12; i < 21; i += 3) + j = i; + if (i != 21 || j != 18) + abort (); +#pragma omp parallel for lastprivate (i, j) num_threads (8) schedule (dynamic, 3) + for (i = -12; i < 21; i += 3) + j = i; + if (i != 21 || j != 18) + abort (); + return 0; +} |