+2014-09-20 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
+ Tobias Burnus <burnus@net-b.de>
+
+ * trans-intrinsic.c (conv_intrinsic_atomic_op): Fix issue with
+ generating temporary for value argument.
+
2014-09-20 Joost VandeVondele <vondele@gcc.gnu.org>
* trans-expr.c (gfc_reset_vptr): Fix comment whitespace.
else
image_index = integer_zero_node;
- if (TREE_TYPE (TREE_TYPE (atom)) != TREE_TYPE (TREE_TYPE (value)))
+ if (!POINTER_TYPE_P (TREE_TYPE (value)))
{
tmp = gfc_create_var (TREE_TYPE (TREE_TYPE (atom)), "value");
gfc_add_modify (&block, tmp, fold_convert (TREE_TYPE (tmp), value));
+2014-09-20 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
+ Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/coarray_atomic_5.f90: New
+
2014-09-19 Jan Hubicka <hubicka@ucw.cz>
PR c++/61825
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fdump-tree-original -fcoarray=lib" }
+!
+! Argument passing was wrong
+!
+
+program atomic
+ use iso_fortran_env
+ implicit none
+
+ integer :: me
+ integer(atomic_int_kind) :: atom[*]
+ me = this_image()
+ call atomic_define(atom[1],0)
+ sync all
+ call ATOMIC_ADD (atom[1], me)
+ if(me == 1) call atomic_ref(me,atom[1])
+ sync all
+ write(*,*) me
+end program
+
+! { dg-final { scan-tree-dump-times "value.. = 0;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_atomic_define \\(caf_token.0, 0, 1, &value.., 0B, 1, 4\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_atomic_op \\(1, caf_token.0, 0, 1, &me, 0B, 0B, 1, 4\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_atomic_ref \\(caf_token.0, 0, 1, &me, 0B, 1, 4\\);" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }