[Bug fortran/63938] OpenMP atomic update does not protect access to automatic array

2014-11-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63938

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Jakub Jelinek  ---
Fixed.


[Bug fortran/63938] OpenMP atomic update does not protect access to automatic array

2014-11-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63938

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Nov 28 17:04:51 2014
New Revision: 218167

URL: https://gcc.gnu.org/viewcvs?rev=218167&root=gcc&view=rev
Log:
Backported from mainline
2014-11-24  Jakub Jelinek  

PR fortran/63938
* trans-openmp.c (gfc_trans_omp_atomic): Make sure lhsaddr is
simple enough for goa_lhs_expr_p.

* libgomp.fortran/pr63938-1.f90: New test.
* libgomp.fortran/pr63938-2.f90: New test.

Added:
branches/gcc-4_8-branch/libgomp/testsuite/libgomp.fortran/pr63938-1.f90
branches/gcc-4_8-branch/libgomp/testsuite/libgomp.fortran/pr63938-2.f90
Modified:
branches/gcc-4_8-branch/gcc/fortran/ChangeLog
branches/gcc-4_8-branch/gcc/fortran/trans-openmp.c
branches/gcc-4_8-branch/libgomp/ChangeLog


[Bug fortran/63938] OpenMP atomic update does not protect access to automatic array

2014-11-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63938

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Nov 28 13:36:36 2014
New Revision: 218153

URL: https://gcc.gnu.org/viewcvs?rev=218153&root=gcc&view=rev
Log:
Backported from mainline
2014-11-24  Jakub Jelinek  

PR fortran/63938
* trans-openmp.c (gfc_trans_omp_atomic): Make sure lhsaddr is
simple enough for goa_lhs_expr_p.

* libgomp.fortran/pr63938-1.f90: New test.
* libgomp.fortran/pr63938-2.f90: New test.

Added:
branches/gcc-4_9-branch/libgomp/testsuite/libgomp.fortran/pr63938-1.f90
branches/gcc-4_9-branch/libgomp/testsuite/libgomp.fortran/pr63938-2.f90
Modified:
branches/gcc-4_9-branch/gcc/fortran/ChangeLog
branches/gcc-4_9-branch/gcc/fortran/trans-openmp.c
branches/gcc-4_9-branch/libgomp/ChangeLog


[Bug fortran/63938] OpenMP atomic update does not protect access to automatic array

2014-11-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63938

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Mon Nov 24 23:08:26 2014
New Revision: 218031

URL: https://gcc.gnu.org/viewcvs?rev=218031&root=gcc&view=rev
Log:
PR fortran/63938
* trans-openmp.c (gfc_trans_omp_atomic): Make sure lhsaddr is
simple enough for goa_lhs_expr_p.

* libgomp.fortran/pr63938-1.f90: New test.
* libgomp.fortran/pr63938-2.f90: New test.

Added:
trunk/libgomp/testsuite/libgomp.fortran/pr63938-1.f90
trunk/libgomp/testsuite/libgomp.fortran/pr63938-2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-openmp.c
trunk/libgomp/ChangeLog


[Bug fortran/63938] OpenMP atomic update does not protect access to automatic array

2014-11-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63938

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Created attachment 34088
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34088&action=edit
gcc5-pr63938.patch

Untested fix.


[Bug fortran/63938] OpenMP atomic update does not protect access to automatic array

2014-11-24 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63938

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|--- |4.8.4


[Bug fortran/63938] OpenMP atomic update does not protect access to automatic array

2014-11-23 Thread Joost.VandeVondele at mat dot ethz.ch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63938

Joost VandeVondele  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-11-24
 CC||Joost.VandeVondele at mat dot 
ethz
   ||.ch
 Ever confirmed|0   |1
  Known to fail||4.7.2, 4.8.3, 4.9.2, 5.0

--- Comment #1 from Joost VandeVondele  
---
confirmed to affect all open branches, and at all optimization levels.

It is triggered by the fact that the array index is a constant, i.e.

this fails:

!$omp atomic
 x(1) = x(1) + 1

this works:

!$omp atomic
 x(j) = x(j) + 1