This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR85463 '[nvptx] "exit" in offloaded region doesn't terminate process' (was: [patch, libfortran, committed] Implement stop_numeric for minimal targets)
Hi!
On Thu, 19 Apr 2018 13:32:16 +0200, Thomas König <tk@tkoenig.net> wrote:
> > Mapping exit to abort is weird,
>
> For Fortran, this is mapping STOP with a numeric code to abort.
>
> The Fortran standard does not apply in this case. What does the OpenACC
> standard say about STOP in an offloaded region?
Nothing explicitly, as far as I know. ;-/ Which means, that this either
a) has to be forbidden, or b) some common sense implementation is called
for. Well, implicitly it's meant such that "standard Fortran language
usage" is supported inside such offloading regions. And, as code like:
!$ACC PARALLEL
[compute A]
if (.not. [sanity check computation A]) then
stop 1
end if
[compute B, using A]
!$ACC END PARALLEL
[compute C, using A and B]
... certainly is a reasonable thing to support, option b) clearly is
preferrable over option a). Before my patch, if "[sanity check
computation A]" failed, the offloading region would terminate normally,
without executing "[compute B, using A]", but would then erroneously
"[compute C, using A and B]" with bogus data, so mapping that offloading
region's "stop 1" to "abort" again is an improvement, to make the "sanity
check" error observable.
Grüße
Thomas