diff options
author | Cesar Philippidis <cesar@codesourcery.com> | 2019-02-14 05:44:19 -0800 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gcc.gnu.org> | 2019-02-14 14:44:19 +0100 |
commit | affd7d477acb4a19dd588e51e6d5597679d0391d (patch) | |
tree | 9a9ef5fd502c9bb9ce68499efcf2d9ea02c48f1e /gcc/fortran/openmp.c | |
parent | 696c5b27c524cf65c6b06e93e62f047faad40a78 (diff) | |
download | gcc-affd7d477acb4a19dd588e51e6d5597679d0391d.zip gcc-affd7d477acb4a19dd588e51e6d5597679d0391d.tar.gz gcc-affd7d477acb4a19dd588e51e6d5597679d0391d.tar.bz2 |
Fix PR72715 "ICE in gfc_trans_omp_do, at fortran/trans-openmp.c:3164"
The OpenACC 'resolve_oacc_nested_loops' function duplicates most code of the
OpenMP 'resolve_omp_do', but didn't include the PR60127 "ICE with OpenMP and DO
CONCURRENT" (trunk r210331) changes. (Probably the two functions should be
unified?)
The Fortran DO CONCURRENT construct is a way to tell the compiler that loop
iterations don't have any interdependencies -- which is information that would
very well be suitable for OpenACC/OpenMP loops. There are some "details"
however, see the discussion/references in PR60127, so for the time being, make
this a compile-time error instead of an ICE.
gcc/fortran/
* openmp.c (resolve_oacc_nested_loops): Error on do concurrent
loops.
gcc/testsuite/
* gfortran.dg/goacc/loop-3-2.f95: Error on do concurrent loops.
* gfortran.dg/goacc/loop-3.f95: Likewise.
* gfortran.dg/goacc/pr72715.f90: New test.
Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
From-SVN: r268875
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r-- | gcc/fortran/openmp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 15c5842..8651afa 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -5760,7 +5760,13 @@ resolve_oacc_nested_loops (gfc_code *code, gfc_code* do_code, int collapse, "at %L", &do_code->loc); break; } - gcc_assert (do_code->op == EXEC_DO || do_code->op == EXEC_DO_CONCURRENT); + if (do_code->op == EXEC_DO_CONCURRENT) + { + gfc_error ("!$ACC LOOP cannot be a DO CONCURRENT loop at %L", + &do_code->loc); + break; + } + gcc_assert (do_code->op == EXEC_DO); if (do_code->ext.iterator->var->ts.type != BT_INTEGER) gfc_error ("!$ACC LOOP iteration variable must be of type integer at %L", &do_code->loc); |