Hi!

I've added "binary" word to the diagnostics, because apparently it wasn't
clear that unary - (and unary +) aren't valid for !$omp atomic.

Committed to trunk.

2013-12-16  Jakub Jelinek  <ja...@redhat.com>

        PR libgomp/59337
        * openmp.c (resolve_omp_atomic): Adjust error message.

        * gfortran.dg/gomp/pr59337.f90: New test.

--- gcc/fortran/openmp.c.jj     2013-08-23 09:28:03.000000000 +0200
+++ gcc/fortran/openmp.c        2013-12-16 16:13:50.295846238 +0100
@@ -1279,7 +1279,7 @@ resolve_omp_atomic (gfc_code *code)
          alt_op = INTRINSIC_EQV;
          break;
        default:
-         gfc_error ("!$OMP ATOMIC assignment operator must be "
+         gfc_error ("!$OMP ATOMIC assignment operator must be binary "
                     "+, *, -, /, .AND., .OR., .EQV. or .NEQV. at %L",
                     &expr2->where);
          return;
--- gcc/testsuite/gfortran.dg/gomp/pr59337.f90.jj       2013-12-16 
16:15:14.203409196 +0100
+++ gcc/testsuite/gfortran.dg/gomp/pr59337.f90  2013-12-16 16:14:56.000000000 
+0100
@@ -0,0 +1,8 @@
+! PR libgomp/59337
+! { dg-do compile }
+! { dg-options "-fopenmp" }
+
+  integer :: i
+  i = 0
+  !$omp atomic
+  i = -i       ! { dg-error "assignment operator must be binary\[^\n\r]*-" }
+end

        Jakub

Reply via email to