]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device...
authorThomas Schwinge <tschwinge@baylibre.com>
Mon, 14 Oct 2024 08:45:06 +0000 (10:45 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Fri, 6 Dec 2024 08:48:33 +0000 (09:48 +0100)
The motivation of the 'gimple_fold_builtin_acc_on_device' change in
commit 3269a722b7a03613e9c4e2862bc5088c4a17cc11
"Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device"
is unclear, and it unnecessarily diverges GCC's (default)
'--disable-offload-targets' vs. '--enable-offload-targets=[...]'
configurations.

PR testsuite/82250
gcc/
* gimple-fold.cc (gimple_fold_builtin_acc_on_device): Revert last
change.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c: Revert
last change.

gcc/gimple-fold.cc
libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c

index 3c72cd6c79ae689186157154763fcc1863027ca2..3c0abf26be7aba44b618e8cb48855bb6646884c2 100644 (file)
@@ -4231,7 +4231,7 @@ static bool
 gimple_fold_builtin_acc_on_device (gimple_stmt_iterator *gsi, tree arg0)
 {
   /* Defer folding until we know which compiler we're in.  */
-  if (ENABLE_OFFLOADING && symtab->state != EXPANSION)
+  if (symtab->state != EXPANSION)
     return false;
 
   unsigned val_host = GOMP_DEVICE_HOST;
index e64711b536bb7036671936f6e8c522a60ad0e25f..7dc7459e5fe1d27d694f938f9eb580f5ae245f35 100644 (file)
@@ -36,7 +36,8 @@ static int fact_nohost(int n)
 
   return fact(n);
 }
-/* { dg-final { scan-tree-dump-times {(?n)^OpenACC routine 'fact_nohost' has 'nohost' clause\.$} 1 oaccloops { target { c && offloading_enabled } } } }
+/* { dg-final { scan-tree-dump-times {(?n)^OpenACC routine 'fact_nohost' has 'nohost' clause\.$} 1 oaccloops { target c } } }
+   { dg-final { scan-tree-dump-times {(?n)^OpenACC routine 'int fact_nohost\(int\)' has 'nohost' clause\.$} 1 oaccloops { target { c++ && { ! offloading_enabled } } } } }
    { dg-final { scan-tree-dump-times {(?n)^OpenACC routine 'fact_nohost\(int\)' has 'nohost' clause\.$} 1 oaccloops { target { c++ && offloading_enabled } } } }
    TODO See PR101551 for 'offloading_enabled' differences.  */