]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Clean up after newlib "nvptx: In offloading execution, map '_exit' to 'abort' [GCC...
authorThomas Schwinge <thomas@codesourcery.com>
Thu, 19 Jan 2023 19:25:45 +0000 (20:25 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 20 Jan 2023 19:54:06 +0000 (20:54 +0100)
PR target/85463
libgfortran/
* runtime/minimal.c [__nvptx__] (exit): Don't override.
libgomp/
* config/nvptx/error.c (exit): Don't override.
* testsuite/libgomp.oacc-fortran/error_stop-1.f: Update.
* testsuite/libgomp.oacc-fortran/error_stop-2.f: Likewise.
* testsuite/libgomp.oacc-fortran/error_stop-3.f: Likewise.
* testsuite/libgomp.oacc-fortran/stop-1.f: Likewise.
* testsuite/libgomp.oacc-fortran/stop-2.f: Likewise.
* testsuite/libgomp.oacc-fortran/stop-3.f: Likewise.

libgfortran/ChangeLog.omp [new file with mode: 0644]
libgfortran/runtime/minimal.c
libgomp/ChangeLog.omp
libgomp/config/nvptx/error.c
libgomp/testsuite/libgomp.oacc-fortran/error_stop-1.f
libgomp/testsuite/libgomp.oacc-fortran/error_stop-2.f
libgomp/testsuite/libgomp.oacc-fortran/error_stop-3.f
libgomp/testsuite/libgomp.oacc-fortran/stop-1.f
libgomp/testsuite/libgomp.oacc-fortran/stop-2.f
libgomp/testsuite/libgomp.oacc-fortran/stop-3.f

diff --git a/libgfortran/ChangeLog.omp b/libgfortran/ChangeLog.omp
new file mode 100644 (file)
index 0000000..b08c264
--- /dev/null
@@ -0,0 +1,4 @@
+2023-01-20  Thomas Schwinge  <thomas@codesourcery.com>
+
+       PR target/85463
+       * runtime/minimal.c [__nvptx__] (exit): Don't override.
index 326ff822ca75f2e301c2f9c0e3b8bebdae4194ed..5af2bada2f6dad2b2f5c521e03c9ad240e8afce1 100644 (file)
@@ -31,14 +31,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #endif
 
 
-#if __nvptx__
-/* Map "exit" to "abort"; see PR85463 '[nvptx] "exit" in offloaded region
-   doesn't terminate process'.  */
-# undef exit
-# define exit(status) do { (void) (status); abort (); } while (0)
-#endif
-
-
 #if __nvptx__
 /* 'printf' is all we have.  */
 # undef estr_vprintf
index 134d450f44a91dee88ccebcd9046e1eaa47cea54..33aa4b01350b677af7e69fbebc4f41c351233886 100644 (file)
@@ -1,5 +1,14 @@
 2023-01-20  Thomas Schwinge  <thomas@codesourcery.com>
 
+       PR target/85463
+       * config/nvptx/error.c (exit): Don't override.
+       * testsuite/libgomp.oacc-fortran/error_stop-1.f: Update.
+       * testsuite/libgomp.oacc-fortran/error_stop-2.f: Likewise.
+       * testsuite/libgomp.oacc-fortran/error_stop-3.f: Likewise.
+       * testsuite/libgomp.oacc-fortran/stop-1.f: Likewise.
+       * testsuite/libgomp.oacc-fortran/stop-2.f: Likewise.
+       * testsuite/libgomp.oacc-fortran/stop-3.f: Likewise.
+
        * testsuite/libgomp.c/simd-math-1.c: Fix configuration, again.
 
        * testsuite/libgomp.oacc-c-c++-common/abort-3.c: Force
index ab99130ed4ab38b15ea8818bc6c2d0e4b60ce5f6..1756eaeee533ded70f17b3ac20d88aaefd7461b8 100644 (file)
 #endif
 
 
-/* The 'exit (EXIT_FAILURE);' of an Fortran (only, huh?) OpenMP 'error'
-   directive with 'severity (fatal)' causes a hang, so 'abort' instead of
-   'exit'.  */
-#undef exit
-#define exit(status) abort ()
-
-
 #include "../../error.c"
index de727749a53fb261c05d3d60a74e7dca8c8848f8..3918d6853f620d8185f381c60a90b316b6b5b9a1 100644 (file)
       END PROGRAM MAIN
 
 ! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
+
 ! { dg-output "ERROR STOP (\n|\r\n|\r)+" }
 !
 ! In gfortran's main program, libfortran's set_options is called - which sets
 ! compiler_options.backtrace = 1 by default.  For an offload libgfortran, this
 ! is never called and, hence, "Error termination." is never printed.  Thus:
 ! { dg-output "Error termination.*" { target { ! { openacc_nvidia_accel_selected || openacc_radeon_accel_selected } } } }
-!
-! PR85463:
+
+! PR85463.  The 'exit' implementation used with nvptx
+! offloading is a little bit different.
 ! { dg-output "libgomp: cuStreamSynchronize error.*" { target openacc_nvidia_accel_selected } }
-!
+
 ! { dg-shouldfail "" }
index 475c9cb5850768cfc3d05771e3fc0f1248c23032..5951e8cbe64d3f3421a6e7ceeb162a5aaef545ce 100644 (file)
       END PROGRAM MAIN
 
 ! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
+
 ! { dg-output "ERROR STOP 35(\n|\r\n|\r)+" }
 !
 ! In gfortran's main program, libfortran's set_options is called - which sets
 ! compiler_options.backtrace = 1 by default.  For an offload libgfortran, this
 ! is never called and, hence, "Error termination." is never printed.  Thus:
 ! { dg-output "Error termination.*" { target { ! { openacc_nvidia_accel_selected || openacc_radeon_accel_selected } } } }
-!
-! PR85463:
+
+! PR85463.  The 'exit' implementation used with nvptx
+! offloading is a little bit different.
 ! { dg-output "libgomp: cuStreamSynchronize error.*" { target openacc_nvidia_accel_selected } }
-!
+
 ! { dg-shouldfail "" }
index ab63444ce34fddee0f0f13e7ecc18b782757c923..15e02d8b744b6b4754788ed7a88907d39ab06699 100644 (file)
       END PROGRAM MAIN
 
 ! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
+
 ! { dg-output "ERROR STOP SiGN(\n|\r\n|\r)+" }
 !
 ! In gfortran's main program, libfortran's set_options is called - which sets
 ! compiler_options.backtrace = 1 by default.  For an offload libgfortran, this
 ! is never called and, hence, "Error termination." is never printed.  Thus:
 ! { dg-output "Error termination.*" { target { ! { openacc_nvidia_accel_selected || openacc_radeon_accel_selected } } } }
-!
-! PR85463:
+
+! PR85463.  The 'exit' implementation used with nvptx
+! offloading is a little bit different.
 ! { dg-output "libgomp: cuStreamSynchronize error.*" { target openacc_nvidia_accel_selected } }
-!
+
 ! { dg-shouldfail "" }
index 2c00d2e5bf8c56e687dda0793caaf7e584f125cf..590b3c97da4b9ebf1baaa110db7c4f7e9e53ad42 100644 (file)
       END PROGRAM MAIN
 
 ! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
-! PR85463.  The "minimal" libgfortran implementation used with nvptx
+
+! { dg-output "" }
+!
+! PR85463.  The 'exit' implementation used with nvptx
 ! offloading is a little bit different.
 ! { dg-output "libgomp: cuStreamSynchronize error.*" { target openacc_nvidia_accel_selected } }
+
 ! { dg-output "$" }
+
 ! PR85463.  STOP with code zero (as implied here) should actually
-! terminate the process normally, but doesn't in the "minimal"
-! libgfortran implementation used with nvptx offloading.
-! { dg-shouldfail "" { openacc_nvidia_accel_selected } }
+! terminate the process normally, but doesn't with the 'exit'
+! implementation used with nvptx offloading.
+! { dg-shouldfail PR85463 { openacc_nvidia_accel_selected } }
index adade54557c2e3eec6a7f724f7d2e212e2a49606..fe7ee37813a1fd5d4a313ee9070e894a7672d9c5 100644 (file)
       END PROGRAM MAIN
 
 ! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
+
 ! { dg-output "STOP 35(\n|\r\n|\r)+" }
-! PR85463.  The "minimal" libgfortran implementation used with nvptx
+!
+! PR85463.  The 'exit' implementation used with nvptx
 ! offloading is a little bit different.
 ! { dg-output "libgomp: cuStreamSynchronize error.*" { target openacc_nvidia_accel_selected } }
+
 ! { dg-output "$" }
+
 ! { dg-shouldfail "" }
index 157e369d4e7e90a34648745466283342068f5ce9..b28989895b52faf7d5c6b82607270c977ef70e71 100644 (file)
       END PROGRAM MAIN
 
 ! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
+
 ! { dg-output "STOP SiGN(\n|\r\n|\r)+" }
-! PR85463.  The "minimal" libgfortran implementation used with nvptx
+!
+! PR85463.  The 'exit' implementation used with nvptx
 ! offloading is a little bit different.
 ! { dg-output "libgomp: cuStreamSynchronize error.*" { target openacc_nvidia_accel_selected } }
+
 ! { dg-output "$" }
+
 ! PR85463.  STOP with code zero (as implied here) should actually
-! terminate the process normally, but doesn't in the "minimal"
-! libgfortran implementation used with nvptx offloading.
-! { dg-shouldfail "" { openacc_nvidia_accel_selected } }
+! terminate the process normally, but doesn't with the 'exit'
+! implementation used with nvptx offloading.
+! { dg-shouldfail PR85463 { openacc_nvidia_accel_selected } }