public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-6372] [Fortran] Disable front-end optimization for OpenACC atomic (PR93462)
@ 2020-01-31 14:54 Tobias Burnus
0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2020-01-31 14:54 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:6a97d9eae4543a995f895e6739530f55f5d039a7
commit r10-6372-g6a97d9eae4543a995f895e6739530f55f5d039a7
Author: Tobias Burnus <tobias@codesourcery.com>
Date: Fri Jan 31 15:54:21 2020 +0100
[Fortran] Disable front-end optimization for OpenACC atomic (PR93462)
PR fortran/93462
* frontend-passes.c (gfc_code_walker): For EXEC_OACC_ATOMIC, set
in_omp_atomic to true prevent front-end optimization.
PR fortran/93462
* gfortran.dg/goacc/atomic-1.f90: New.
Diff:
---
gcc/fortran/ChangeLog | 16 +++++++++++-----
gcc/fortran/frontend-passes.c | 1 +
gcc/testsuite/ChangeLog | 5 +++++
gcc/testsuite/gfortran.dg/goacc/atomic-1.f90 | 17 +++++++++++++++++
4 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index b8f70e61..9b17daf 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2020-01-31 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93462
+ * frontend-passes.c (gfc_code_walker): For EXEC_OACC_ATOMIC, set
+ in_omp_atomic to true prevent front-end optimization.
+
2020-01-30 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
PR fortran/87103
@@ -25,11 +31,11 @@
2020-01-28 Andrew Benson <abensonca@gmail.com>
- PR fortran/93461
- * trans.h: Increase GFC_MAX_MANGLED_SYMBOL_LEN to
- GFC_MAX_SYMBOL_LEN*3+5 to allow for inclusion of submodule name,
- plus the "." between module and submodule names.
- * gfortran.dg/pr93461.f90: New test.
+ PR fortran/93461
+ * trans.h: Increase GFC_MAX_MANGLED_SYMBOL_LEN to
+ GFC_MAX_SYMBOL_LEN*3+5 to allow for inclusion of submodule name,
+ plus the "." between module and submodule names.
+ * gfortran.dg/pr93461.f90: New test.
2020-01-28 Andrew Benson <abensonca@gmail.com>
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index de11524..bbe34d6 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -5258,6 +5258,7 @@ gfc_code_walker (gfc_code **c, walk_code_fn_t codefn, walk_expr_fn_t exprfn,
WALK_SUBEXPR (co->ext.dt->extra_comma);
break;
+ case EXEC_OACC_ATOMIC:
case EXEC_OMP_ATOMIC:
in_omp_atomic = true;
break;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8b1dcf2..f95d2d4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-31 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/93462
+ * gfortran.dg/goacc/atomic-1.f90: New.
+
2020-01-31 Tamar Christina <tamar.christina@arm.com>
PR rtl-optimization/91838
diff --git a/gcc/testsuite/gfortran.dg/goacc/atomic-1.f90 b/gcc/testsuite/gfortran.dg/goacc/atomic-1.f90
new file mode 100644
index 0000000..579f049
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/atomic-1.f90
@@ -0,0 +1,17 @@
+! { dg-do compile }
+!
+! PR fortran/93462
+!
+! Contributed by G. Steinmetz
+!
+program p
+ integer :: n = 1
+ integer :: a
+!$acc atomic write
+ a = f(n) - f(n)
+contains
+ integer function f(x)
+ integer, intent(in) :: x
+ f = x
+ end
+end
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-31 14:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31 14:54 [gcc r10-6372] [Fortran] Disable front-end optimization for OpenACC atomic (PR93462) Tobias Burnus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).