]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx, libgfortran: Switch out of "minimal" mode
authorThomas Schwinge <thomas@codesourcery.com>
Wed, 21 Sep 2022 16:58:34 +0000 (18:58 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Fri, 20 Jan 2023 21:05:48 +0000 (22:05 +0100)
..., in order to enable (portions of) Fortran I/O, for example.

libgfortran/ChangeLog:

* configure: Regenerate.
* configure.ac: No longer set LIBGFOR_MINIMAL for nvptx.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/target-print-1.f90: Adjust.
* testsuite/libgomp.fortran/target-print-1-nvptx.f90: Remove.
* testsuite/libgomp.oacc-fortran/print-1.f90: Adjust.
* testsuite/libgomp.oacc-fortran/print-1-nvptx.f90: Remove.
* testsuite/libgomp.oacc-fortran/error_stop-2.f: Adjust.
* testsuite/libgomp.oacc-fortran/stop-2.f: Likewise.

Co-authored-by: Andrew Stubbs <ams@codesourcery.com>
libgfortran/ChangeLog.omp
libgfortran/configure
libgfortran/configure.ac
libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.fortran/target-print-1-nvptx.f90 [deleted file]
libgomp/testsuite/libgomp.fortran/target-print-1.f90
libgomp/testsuite/libgomp.oacc-fortran/error_stop-2.f
libgomp/testsuite/libgomp.oacc-fortran/print-1-nvptx.f90 [deleted file]
libgomp/testsuite/libgomp.oacc-fortran/print-1.f90
libgomp/testsuite/libgomp.oacc-fortran/stop-2.f

index b08c264daf986fcdb6abfaac87fee6ca39244d3f..925575e65fae1424087e266615ca90164f8bfdac 100644 (file)
@@ -1,3 +1,9 @@
+2023-01-20  Thomas Schwinge  <thomas@codesourcery.com>
+           Andrew Stubbs  <ams@codesourcery.com>
+
+       * configure: Regenerate.
+       * configure.ac: No longer set LIBGFOR_MINIMAL for nvptx.
+
 2023-01-20  Thomas Schwinge  <thomas@codesourcery.com>
 
        PR target/85463
index ae64dca31140e2502752aa9dcb2f1ef913beba88..3e5c931d4ad0eb9d2016c85b1efc006e981241e2 100755 (executable)
@@ -6230,17 +6230,12 @@ else
 fi
 
 
-# For GPU offloading, not everything in libfortran can be supported.
-# Currently, the only target that has this problem is nvptx.  The
-# following is a (partial) list of features that are unsupportable on
-# this particular target:
-# * Constructors
-# * alloca
-# * C library support for I/O, with printf as the one notable exception
-# * C library support for other features such as signal, environment
-#   variables, time functions
-
- if test "x${target_cpu}" = xnvptx; then
+# "Minimal" mode is for targets that cannot (yet) support all features of
+# libgfortran.  It avoids the need for working constructors, alloca, and C
+# library support for I/O, signals, environment variables, time functions, etc.
+# At present there are no targets that require this mode.
+
+ if false; then
   LIBGFOR_MINIMAL_TRUE=
   LIBGFOR_MINIMAL_FALSE='#'
 else
index 97cc490cb5e93af786c74da1fd607c8268292e52..e5552949cc6ff43ab40657cbe7f061507b031850 100644 (file)
@@ -222,17 +222,12 @@ AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno])
 AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu])
 AM_CONDITIONAL(LIBGFOR_USE_SYMVER_SUN, [test "x$gfortran_use_symver" = xsun])
 
-# For GPU offloading, not everything in libfortran can be supported.
-# Currently, the only target that has this problem is nvptx.  The
-# following is a (partial) list of features that are unsupportable on
-# this particular target:
-# * Constructors
-# * alloca
-# * C library support for I/O, with printf as the one notable exception
-# * C library support for other features such as signal, environment
-#   variables, time functions
-
-AM_CONDITIONAL(LIBGFOR_MINIMAL, [test "x${target_cpu}" = xnvptx])
+# "Minimal" mode is for targets that cannot (yet) support all features of
+# libgfortran.  It avoids the need for working constructors, alloca, and C
+# library support for I/O, signals, environment variables, time functions, etc.
+# At present there are no targets that require this mode.
+
+AM_CONDITIONAL(LIBGFOR_MINIMAL, false)
 
 # Some compiler target support may have limited support for integer
 # or floating point numbers – or may want to reduce the libgfortran size
index 32aa97052965413539164b63abd5d6aaa4f9b5cc..30b1e558ea380c37396f40aec54bd11558b1a911 100644 (file)
@@ -1,5 +1,12 @@
 2023-01-20  Thomas Schwinge  <thomas@codesourcery.com>
 
+       * testsuite/libgomp.fortran/target-print-1.f90: Adjust.
+       * testsuite/libgomp.fortran/target-print-1-nvptx.f90: Remove.
+       * testsuite/libgomp.oacc-fortran/print-1.f90: Adjust.
+       * testsuite/libgomp.oacc-fortran/print-1-nvptx.f90: Remove.
+       * testsuite/libgomp.oacc-fortran/error_stop-2.f: Adjust.
+       * testsuite/libgomp.oacc-fortran/stop-2.f: Likewise.
+
        * plugin/plugin-nvptx.c (nvptx_do_global_cdtors): New.
        (nvptx_close_device, GOMP_OFFLOAD_load_image)
        (GOMP_OFFLOAD_unload_image): Call it.
diff --git a/libgomp/testsuite/libgomp.fortran/target-print-1-nvptx.f90 b/libgomp/testsuite/libgomp.fortran/target-print-1-nvptx.f90
deleted file mode 100644 (file)
index a89c9c3..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-! Ensure that write on the offload device works, nvptx offloading variant.
-
-! This doesn't compile: for nvptx offloading we're using a minimal libgfortran
-! configuration.
-! { dg-do link } ! ..., but still apply 'dg-do run' options.
-! { dg-xfail-if "minimal libgfortran" { offload_target_nvptx } }
-
-! Skip duplicated testing.
-! { dg-skip-if "separate file" { ! offload_target_nvptx } }
-
-include 'target-print-1.f90'
index 327bb22cb6d976653bd30b1476a9563fbc25f578..9ac70e5a85fe66ef13e59cf99849513e796fb503 100644 (file)
@@ -3,9 +3,6 @@
 ! { dg-do run }
 ! { dg-output "The answer is 42(\n|\r\n|\r)+" }
 
-! Separate file 'target-print-1-nvptx.f90' for nvptx offloading.
-! { dg-skip-if "separate file" { offload_target_nvptx } }
-
 program main
   implicit none
   integer :: var = 42
index 5951e8cbe64d3f3421a6e7ceeb162a5aaef545ce..bbb4b55ef2ce17361bc061f7175e0edbe94412c4 100644 (file)
@@ -17,7 +17,9 @@
 
 ! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
 
-! { dg-output "ERROR STOP 35(\n|\r\n|\r)+" }
+! '_gfortran_error_stop_numeric' -> '_gfortrani_st_printf' -> [...]
+! overflows the stack for nvptx offloading, thus XFAILed.
+! { dg-output "ERROR STOP 35(\n|\r\n|\r)+" { xfail openacc_nvidia_accel_selected } }
 !
 ! In gfortran's main program, libfortran's set_options is called - which sets
 ! compiler_options.backtrace = 1 by default.  For an offload libgfortran, this
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/print-1-nvptx.f90 b/libgomp/testsuite/libgomp.oacc-fortran/print-1-nvptx.f90
deleted file mode 100644 (file)
index 866c865..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-! Ensure that write on the offload device works, nvptx offloading variant.
-
-! This doesn't compile: for nvptx offloading we're using a minimal libgfortran
-! configuration.
-! { dg-do link } ! ..., but still apply 'dg-do run' options.
-! { dg-xfail-if "minimal libgfortran" { offload_target_nvptx } }
-
-! Skip duplicated testing.
-! { dg-skip-if "separate file" { ! offload_target_nvptx } }
-
-include 'print-1.f90'
index d2f89d915f8901a0455ebc0122f495850f91be50..d04503a024952d31bef7cee845bc3296f7587eb8 100644 (file)
@@ -2,9 +2,8 @@
 
 ! { dg-do run }
 ! { dg-output "The answer is 42(\n|\r\n|\r)+" }
-
-! Separate file 'print-1-nvptx.f90' for nvptx offloading.
-! { dg-skip-if "separate file" { offload_target_nvptx } }
+! The 'write' overflows the stack for nvptx offloading, thus XFAILed.
+! { dg-xfail-run-if TODO { openacc_nvidia_accel_selected } }
 
 ! { dg-additional-options "-fopt-info-note-omp" }
 ! { dg-additional-options "-foffload=-fopt-info-note-omp" }
index fe7ee37813a1fd5d4a313ee9070e894a7672d9c5..394de034b1f5048d23948daa4e2bf3dd7aebd4ab 100644 (file)
@@ -17,7 +17,9 @@
 
 ! { dg-output "CheCKpOInT(\n|\r\n|\r)+" }
 
-! { dg-output "STOP 35(\n|\r\n|\r)+" }
+! '_gfortran_error_stop_numeric' -> '_gfortrani_st_printf' -> [...]
+! overflows the stack for nvptx offloading, thus XFAILed.
+! { dg-output "STOP 35(\n|\r\n|\r)+" { xfail openacc_nvidia_accel_selected } }
 !
 ! PR85463.  The 'exit' implementation used with nvptx
 ! offloading is a little bit different.