[17/25] Fix Fortran STOP.

Message ID 3b1ee6252e6bc42be1886f45fd4512efda27bcbd.1536144068.git.ams@codesourcery.com
State New
Headers show
Series
  • AMD GCN Port
Related show

Commit Message

Andrew Stubbs Sept. 5, 2018, 11:51 a.m.
The minimal libgfortran setup was created for NVPTX, but will also be used by
AMD GCN.

This patch simply removes an assumption that NVPTX is the only user.
Specifically, NVPTX exit is broken, but AMD GCN exit works just fine.

2018-09-05  Andrew Stubbs  <ams@codesourcery.com>

	libgfortran/
	* runtime/minimal.c (exit): Only work around nvptx bugs on nvptx.
---
 libgfortran/runtime/minimal.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Janne Blomqvist Sept. 5, 2018, 6:09 p.m. | #1
Same, please send fortran patches to the fortran list as well!

On Wed, Sep 5, 2018 at 7:55 PM Toon Moene <toon@moene.org> wrote:

>

>

>

> -------- Forwarded Message --------

> Subject: [PATCH 17/25] Fix Fortran STOP.

> Date: Wed, 5 Sep 2018 12:51:18 +0100

> From: ams@codesourcery.com

> To: gcc-patches@gcc.gnu.org

>

>

> The minimal libgfortran setup was created for NVPTX, but will also be

> used by

> AMD GCN.

>

> This patch simply removes an assumption that NVPTX is the only user.

> Specifically, NVPTX exit is broken, but AMD GCN exit works just fine.

>

> 2018-09-05  Andrew Stubbs  <ams@codesourcery.com>

>

>         libgfortran/

>         * runtime/minimal.c (exit): Only work around nvptx bugs on nvptx.

> ---

>   libgfortran/runtime/minimal.c | 2 ++

>   1 file changed, 2 insertions(+)

>

>

Ok, thanks.


-- 
Janne Blomqvist
Andrew Stubbs Sept. 12, 2018, 1:56 p.m. | #2
On 05/09/18 19:09, Janne Blomqvist wrote:
> Ok, thanks.


Committed, thanks.

Andrew

Patch

diff --git a/libgfortran/runtime/minimal.c b/libgfortran/runtime/minimal.c
index 0b1efeb..8940f97 100644
--- a/libgfortran/runtime/minimal.c
+++ b/libgfortran/runtime/minimal.c
@@ -197,10 +197,12 @@  sys_abort (void)
 #define st_printf printf
 #undef estr_write
 #define estr_write printf
+#if __nvptx__
 /* Map "exit" to "abort"; see PR85463 '[nvptx] "exit" in offloaded region
    doesn't terminate process'.  */
 #undef exit
 #define exit(...) do { abort (); } while (0)
+#endif
 #undef exit_error
 #define exit_error(...) do { abort (); } while (0)