aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-10-14 10:45:06 +0200
committerThomas Schwinge <tschwinge@baylibre.com>2024-12-06 09:48:33 +0100
commitab5bd6ac68c6d9f870fcaf0de4a73f3dec920db9 (patch)
treeff77bb43110fb00c391f1e35d345deeb98ea108c
parent3e14c126de157fe9b87a1ada6e689003735088e1 (diff)
downloadgcc-ab5bd6ac68c6d9f870fcaf0de4a73f3dec920db9.zip
gcc-ab5bd6ac68c6d9f870fcaf0de4a73f3dec920db9.tar.gz
gcc-ab5bd6ac68c6d9f870fcaf0de4a73f3dec920db9.tar.bz2
Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device: Revert 'gimple_fold_builtin_acc_on_device' change
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.
-rw-r--r--gcc/gimple-fold.cc2
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index 3c72cd6..3c0abf2 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -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;
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c
index e64711b..7dc7459e 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c
@@ -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. */