public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43711]  New: Unformitive error message for two NOWAIT in OpenMP directive
@ 2010-04-09 20:42 longb at cray dot com
  2010-05-07 17:24 ` [Bug fortran/43711] " dfranke at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: longb at cray dot com @ 2010-04-09 20:42 UTC (permalink / raw)
  To: gcc-bugs

For the test code:

program NF03_2_5_2_1a
   !$omp parallel
      !$omp sections
      !$omp section
         print *, 'FAIL'
      !$omp section
         print *, 'FAIL'
      !$omp end sections nowait nowait
   !$omp end parallel

   print *, 'FAIL - NF03_2_5_2_1a.f90 should not compile'
   stop 1
end program NF03_2_5_2_1a

the second 'nowait' on the !$omp end sections directive is not correct.  The
gfortran compiler issues this message:

> gfortran -c -fopenmp test.f90
test.f90:8.12:

      !$omp end sections nowait nowait
            1
Error: Unclassifiable OpenMP directive at (1)
test.f90:9.21:

A more useful message would be better. For example, PGI issues:


> pgf90 -mp -c test.f90
PGF90-S-0034-Syntax error at or near NOWAIT (test.f90: 8)
  0 inform,   0 warnings,   1 severes, 0 fatal for nf03_2_5_2_1a


which at least points to the NOWAIT as the problem.

Since gfortran is failing to recognize the end section statement, there are
further errors issued for the test case:

test.f90:9.21:

   !$omp end parallel
                     1
Error: Unexpected !$OMP END PARALLEL statement at (1)
test.f90:13.3:

end program NF03_2_5_2_1a
   1
Error: Unexpected END statement at (1)
Error: Unexpected end of file in 'test.f90'

which compound the possible confusion.


-- 
           Summary: Unformitive error message for two NOWAIT in OpenMP
                    directive
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: longb at cray dot com
 GCC build triplet: x86_64-suse-linux
  GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43711


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/43711] Unformitive error message for two NOWAIT in OpenMP directive
  2010-04-09 20:42 [Bug fortran/43711] New: Unformitive error message for two NOWAIT in OpenMP directive longb at cray dot com
@ 2010-05-07 17:24 ` dfranke at gcc dot gnu dot org
  2010-05-07 17:42 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-07 17:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dfranke at gcc dot gnu dot org  2010-05-07 17:23 -------
In openmp.c (gfc_match_omp_end_nowait), we match "nowait" and end-of-string. If
there's anything but whitespace after the nowait, the match is rejected.

With "nowait" being rejected, parse.c (match_word) rejects the whole matching
sequence, { "end sections" "nowait" end-of-string } and returns to the last
known locus, here just after the "$omp".

67  if (m != MATCH_YES)
68    {
69      gfc_current_locus = *old_locus;
70      reject_statement ();
71    }

If line 69 is removed, one gets:

pr43711.f90:8.31:

      !$omp end sections nowait nowait
                               1
Error: Unclassifiable OpenMP directive at (1)

But everything else is broken ^^


This is not specific for nowait, but for all OpenMP related things that
explicitly check for end-of-string.


I believe, this is eventually the same as PR32365.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|x86_64-suse-linux           |
   GCC host triplet|x86_64-suse-linux           |
 GCC target triplet|x86_64-suse-linux           |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43711


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/43711] Unformitive error message for two NOWAIT in OpenMP directive
  2010-04-09 20:42 [Bug fortran/43711] New: Unformitive error message for two NOWAIT in OpenMP directive longb at cray dot com
  2010-05-07 17:24 ` [Bug fortran/43711] " dfranke at gcc dot gnu dot org
@ 2010-05-07 17:42 ` dfranke at gcc dot gnu dot org
  2010-05-11 16:45 ` dfranke at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-07 17:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dfranke at gcc dot gnu dot org  2010-05-07 17:41 -------
(In reply to comment #1)
> I believe, this is eventually the same as PR32365.

Stupid me. There's actually an easy fix for this one:

Index: openmp.c
===================================================================
--- openmp.c    (revision 159154)
+++ openmp.c    (working copy)
@@ -54,6 +54,8 @@ gfc_match_omp_eos (void)
       return MATCH_YES;
     }

+  gfc_error("Unexpected junk at end of OMP statement at %C");
+
   gfc_current_locus = old_loc;
   return MATCH_NO;
 }


This gives:
$> gfortran-svn -g -Wall -W -fopenmp pr43711.f90 
pr43711.f90:8.33:

      !$omp end sections nowait nowait
                                 1
Error: Unexpected junk at end of OMP statement at (1)


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |dfranke at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-05-07 17:41:39
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43711


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/43711] Unformitive error message for two NOWAIT in OpenMP directive
  2010-04-09 20:42 [Bug fortran/43711] New: Unformitive error message for two NOWAIT in OpenMP directive longb at cray dot com
  2010-05-07 17:24 ` [Bug fortran/43711] " dfranke at gcc dot gnu dot org
  2010-05-07 17:42 ` dfranke at gcc dot gnu dot org
@ 2010-05-11 16:45 ` dfranke at gcc dot gnu dot org
  2010-05-11 16:46 ` dfranke at gcc dot gnu dot org
  2010-05-11 16:47 ` dfranke at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-11 16:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dfranke at gcc dot gnu dot org  2010-05-11 16:45 -------
Subject: Bug 43711

Author: dfranke
Date: Tue May 11 16:45:17 2010
New Revision: 159282

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159282
Log:
gcc/fortran/:
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.


Added:
    trunk/gcc/testsuite/gfortran.dg/gomp/pr43711.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/openmp.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43711


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/43711] Unformitive error message for two NOWAIT in OpenMP directive
  2010-04-09 20:42 [Bug fortran/43711] New: Unformitive error message for two NOWAIT in OpenMP directive longb at cray dot com
                   ` (2 preceding siblings ...)
  2010-05-11 16:45 ` dfranke at gcc dot gnu dot org
@ 2010-05-11 16:46 ` dfranke at gcc dot gnu dot org
  2010-05-11 16:47 ` dfranke at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-11 16:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dfranke at gcc dot gnu dot org  2010-05-11 16:46 -------
Fixed in trunk. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43711


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/43711] Unformitive error message for two NOWAIT in OpenMP directive
  2010-04-09 20:42 [Bug fortran/43711] New: Unformitive error message for two NOWAIT in OpenMP directive longb at cray dot com
                   ` (3 preceding siblings ...)
  2010-05-11 16:46 ` dfranke at gcc dot gnu dot org
@ 2010-05-11 16:47 ` dfranke at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-11 16:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dfranke at gcc dot gnu dot org  2010-05-11 16:46 -------
(In reply to comment #4)
> Fixed in trunk. Closing.
...


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43711


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-11 16:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 20:42 [Bug fortran/43711] New: Unformitive error message for two NOWAIT in OpenMP directive longb at cray dot com
2010-05-07 17:24 ` [Bug fortran/43711] " dfranke at gcc dot gnu dot org
2010-05-07 17:42 ` dfranke at gcc dot gnu dot org
2010-05-11 16:45 ` dfranke at gcc dot gnu dot org
2010-05-11 16:46 ` dfranke at gcc dot gnu dot org
2010-05-11 16:47 ` dfranke at gcc dot gnu dot org

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).