https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92929

--- Comment #6 from jules at gcc dot gnu.org ---
Apologies for breakage. This part of the patch was originally from the og9
patch supporting Fortran polymorphic class pointers posted at
https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00752.html. The rationale was as
follows:

[...] OpenACC "enter data" and "exit data" now have GOMP_MAP_POINTER and
GOMP_MAP_PSET mappings removed during gimplification. In some
circumstances, passing an array to a function/subroutine and then doing
an "enter data" on it could leave dangling references to the function's
stack, although the actual array data is defined outside the function.
In any case, the pointer/pointer-set mappings don't seem to be
necessary for OpenACC "enter data".

I observed the described problem with a large test program, and unfortunately
did not manage to come up with a minimised test case at the time. Someone more
familiar with Fortran might be able to do so more easily than me!

In terms of backwards compatibility, we can't do anything about the "parasitic
binding" to a function's expired stack frame as generated by an older version
of the compiler in this case, I don't think. That's most likely going to
manifest as an intermittent crash.

Reply via email to