]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/fortran/:
authordfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 May 2010 16:45:17 +0000 (16:45 +0000)
committerdfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 May 2010 16:45:17 +0000 (16:45 +0000)
2010-05-11  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/43711
        * openmp.c (gfc_match_omp_taskwait): Report unexpected characters
        after OMP statement.
        (gfc_match_omp_critical): Likewise.
        (gfc_match_omp_flush): Likewise.
        (gfc_match_omp_workshare): Likewise.
        (gfc_match_omp_master): Likewise.
        (gfc_match_omp_ordered): Likewise.
        (gfc_match_omp_atomic): Likewise.
        (gfc_match_omp_barrier): Likewise.
        (gfc_match_omp_end_nowait): Likewise.

gcc/testsuite/:
2010-05-11  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/43711
        * gfortran.dg/gomp/pr43711.f90: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159282 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/openmp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/gomp/pr43711.f90 [new file with mode: 0644]

index 1b8c65ceaa49b61238c18cd927af10063d9a7c3d..86a9574931850ef7bcb0eb45c5de2f7c31467e9c 100644 (file)
@@ -1,3 +1,17 @@
+2010-05-11  Daniel Franke  <franke.daniel@gmail.com>
+
+        PR fortran/43711
+        * openmp.c (gfc_match_omp_taskwait): Report unexpected characters
+        after OMP statement.
+        (gfc_match_omp_critical): Likewise.
+        (gfc_match_omp_flush): Likewise.
+        (gfc_match_omp_workshare): Likewise.
+        (gfc_match_omp_master): Likewise.
+        (gfc_match_omp_ordered): Likewise.
+        (gfc_match_omp_atomic): Likewise.
+        (gfc_match_omp_barrier): Likewise.
+        (gfc_match_omp_end_nowait): Likewise.
+
 2010-05-11  Daniel Franke  <franke.daniel@gmail.com>
 
        PR fortran/31820
index c00e1b41e28c092f80c4454414cadce74350a1b8..bbf7e5a245dcb4c7457311feb74e440671d1c94f 100644 (file)
@@ -467,7 +467,10 @@ match
 gfc_match_omp_taskwait (void)
 {
   if (gfc_match_omp_eos () != MATCH_YES)
-    return MATCH_ERROR;
+    {
+      gfc_error ("Unexpected junk after TASKWAIT clause at %C");
+      return MATCH_ERROR;
+    }
   new_st.op = EXEC_OMP_TASKWAIT;
   new_st.ext.omp_clauses = NULL;
   return MATCH_YES;
@@ -482,7 +485,10 @@ gfc_match_omp_critical (void)
   if (gfc_match (" ( %n )", n) != MATCH_YES)
     n[0] = '\0';
   if (gfc_match_omp_eos () != MATCH_YES)
-    return MATCH_ERROR;
+    {
+      gfc_error ("Unexpected junk after $OMP CRITICAL statement at %C");
+      return MATCH_ERROR;
+    }
   new_st.op = EXEC_OMP_CRITICAL;
   new_st.ext.omp_name = n[0] ? xstrdup (n) : NULL;
   return MATCH_YES;
@@ -508,6 +514,7 @@ gfc_match_omp_flush (void)
   gfc_match_omp_variable_list (" (", &list, true);
   if (gfc_match_omp_eos () != MATCH_YES)
     {
+      gfc_error ("Unexpected junk after $OMP FLUSH statement at %C");
       gfc_free_namelist (list);
       return MATCH_ERROR;
     }
@@ -654,7 +661,10 @@ match
 gfc_match_omp_workshare (void)
 {
   if (gfc_match_omp_eos () != MATCH_YES)
-    return MATCH_ERROR;
+    {
+      gfc_error ("Unexpected junk after $OMP WORKSHARE statement at %C");
+      return MATCH_ERROR;
+    }
   new_st.op = EXEC_OMP_WORKSHARE;
   new_st.ext.omp_clauses = gfc_get_omp_clauses ();
   return MATCH_YES;
@@ -665,7 +675,10 @@ match
 gfc_match_omp_master (void)
 {
   if (gfc_match_omp_eos () != MATCH_YES)
-    return MATCH_ERROR;
+    {
+      gfc_error ("Unexpected junk after $OMP MASTER statement at %C");
+      return MATCH_ERROR;
+    }
   new_st.op = EXEC_OMP_MASTER;
   new_st.ext.omp_clauses = NULL;
   return MATCH_YES;
@@ -676,7 +689,10 @@ match
 gfc_match_omp_ordered (void)
 {
   if (gfc_match_omp_eos () != MATCH_YES)
-    return MATCH_ERROR;
+    {
+      gfc_error ("Unexpected junk after $OMP ORDERED statement at %C");
+      return MATCH_ERROR;
+    }
   new_st.op = EXEC_OMP_ORDERED;
   new_st.ext.omp_clauses = NULL;
   return MATCH_YES;
@@ -687,7 +703,10 @@ match
 gfc_match_omp_atomic (void)
 {
   if (gfc_match_omp_eos () != MATCH_YES)
-    return MATCH_ERROR;
+    {
+      gfc_error ("Unexpected junk after $OMP ATOMIC statement at %C");
+      return MATCH_ERROR;
+    }
   new_st.op = EXEC_OMP_ATOMIC;
   new_st.ext.omp_clauses = NULL;
   return MATCH_YES;
@@ -698,7 +717,10 @@ match
 gfc_match_omp_barrier (void)
 {
   if (gfc_match_omp_eos () != MATCH_YES)
-    return MATCH_ERROR;
+    {
+      gfc_error ("Unexpected junk after $OMP BARRIER statement at %C");
+      return MATCH_ERROR;
+    }
   new_st.op = EXEC_OMP_BARRIER;
   new_st.ext.omp_clauses = NULL;
   return MATCH_YES;
@@ -712,7 +734,10 @@ gfc_match_omp_end_nowait (void)
   if (gfc_match ("% nowait") == MATCH_YES)
     nowait = true;
   if (gfc_match_omp_eos () != MATCH_YES)
-    return MATCH_ERROR;
+    {
+      gfc_error ("Unexpected junk after NOWAIT clause at %C");
+      return MATCH_ERROR;
+    }
   new_st.op = EXEC_OMP_END_NOWAIT;
   new_st.ext.omp_bool = nowait;
   return MATCH_YES;
index 29b19b9c4e7da1a66b7fd07ae3f75002e9a52698..f42ccba69e3ab78c61b6b4a016fdb4e7e53a22f3 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-11  Daniel Franke  <franke.daniel@gmail.com>
+
+        PR fortran/43711
+        * gfortran.dg/gomp/pr43711.f90: New.
+
 2010-05-11  Daniel Franke  <franke.daniel@gmail.com>
 
        PR fortran/31820
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr43711.f90 b/gcc/testsuite/gfortran.dg/gomp/pr43711.f90
new file mode 100644 (file)
index 0000000..9d7806c
--- /dev/null
@@ -0,0 +1,18 @@
+! { dg-do "compile" }
+! { dg-options "-fopenmp" }
+!
+! PR fortran/43711 uninformative error message for two 'nowait' in omp statement
+! Contributed by Bill Long <longb AT cray DOT com>
+
+program NF03_2_5_2_1a
+   !$omp parallel
+      !$omp sections
+      !$omp section
+         print *, 'FAIL'
+      !$omp section
+         print *, 'FAIL'
+      !$omp end sections nowait nowait     ! { dg-error "Unexpected junk" }
+   !$omp end parallel
+end program NF03_2_5_2_1a
+
+! { dg-excess-errors "Unexpected" }
\ No newline at end of file