[Patch, fortran] PR66549 [5/6 regression] ICE with OMP PARALLEL
Mikael Morin
mikael.morin@sfr.fr
Thu Jun 18 11:26:00 GMT 2015
Hello,
I'm proposing here a fix for an OpenMP ICE regression introduced by me
at http://gcc.gnu.org/r221586
That revision changed the order in which procedures are resolved, making
it possible for a procedure to be resolved from within an OpenMP
construct body. As the OpenMP constructs set some global state, the
procedure's do loop were registered as OpenMP-managed loops.
The attached patch clears the OpenMP state upon gfc_resolve entry
and restores it upon return. I don't know the OpenMP code very well,
but it seems reasonable to me to do that.
Regression-tested on x86_64-linux. OK for trunk/5 ?
Mikael
-------------- next part --------------
2015-06-18 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/66549
* resolve.c (resolve_global_procedure): Don't save and restore
OpenMP state around the call to gfc_resolve.
(gfc_resolve): Save OpenMP state on entry and restore it on return.
2015-06-18 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/66549
* gfortran.dg/gomp/omp_parallel_1.f90: New file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr66549_v1.1.diff
Type: text/x-patch
Size: 1737 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150618/39bb8b25/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp_parallel_1.f90
Type: text/x-fortran
Size: 988 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150618/39bb8b25/attachment-0001.bin>
More information about the Gcc-patches
mailing list