public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34325]  New: Wrong error message for syntax error
@ 2007-12-03 12:27 terry at chem dot gu dot se
  2007-12-06  3:52 ` [Bug fortran/34325] " jvdelisle at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: terry at chem dot gu dot se @ 2007-12-03 12:27 UTC (permalink / raw)
  To: gcc-bugs

This is similar to PR 32151

$ gfortran --version
GNU Fortran (GCC) 4.3.0 20071109 (experimental)  <snip>

$cat aa.f90 
program aa
implicit none
real(kind=8)::r1=0
if ((3*r1)**2)<0) stop
end

$ gfortran -c aa.f90
aa.f90:4.14:

if ((3*r1)**2)<0) stop
             1
Error: Cannot assign to a named constant at (1)


It's an extra parenthesis (or, arguably, a missing parenthesis ;-).  Who's
trying to assign anything??!


-- 
           Summary: Wrong error message for syntax error
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: terry at chem dot gu dot se
  GCC host triplet: x86_64-unknown-linux-gnu


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
@ 2007-12-06  3:52 ` jvdelisle at gcc dot gnu dot org
  2007-12-10  3:15 ` jvdelisle at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-06  3:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2007-12-06 03:52 -------
The error is in gfc_match_if.

There is code that is doing gfc_match_assignment in the IF statement twice to
catch the reported condition.  So the invalid code falls through to this and
catches it.  The easy way out is to change the wording to be more general, like
"Error in IF clause at 1"

A better implementation would check for a balance of parenthesis in
gfc_match_assignment and throw the specific error.  Any opinions on this
Tobias,   FX, anyone?


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-12-06 03:52:04
               date|                            |


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
  2007-12-06  3:52 ` [Bug fortran/34325] " jvdelisle at gcc dot gnu dot org
@ 2007-12-10  3:15 ` jvdelisle at gcc dot gnu dot org
  2007-12-14 19:22 ` jvdelisle at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-10  3:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2007-12-10 03:15 -------
I am working on a function to catch the parenthesis problem.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-12-06 03:52:04         |2007-12-10 03:15:31
               date|                            |


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
  2007-12-06  3:52 ` [Bug fortran/34325] " jvdelisle at gcc dot gnu dot org
  2007-12-10  3:15 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-14 19:22 ` jvdelisle at gcc dot gnu dot org
  2007-12-19  5:55 ` jvdelisle at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-14 19:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2007-12-14 19:21 -------
Patch submitted:

http://gcc.gnu.org/ml/gcc-patches/2007-12/msg00685.html


-- 


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (2 preceding siblings ...)
  2007-12-14 19:22 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-19  5:55 ` jvdelisle at gcc dot gnu dot org
  2007-12-19  5:59 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-19  5:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2007-12-19 05:55 -------
Subject: Bug 34325

Author: jvdelisle
Date: Wed Dec 19 05:55:17 2007
New Revision: 131052

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131052
Log:
2007-12-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/34325
        * match.h: New function declaration.
        * match.c (gfc_match_parens): New function to look for mismatched
        parenthesis. (gfc_match_if): Use new function to catch missing '('.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/match.h


-- 


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (4 preceding siblings ...)
  2007-12-19  5:59 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-19  5:59 ` jvdelisle at gcc dot gnu dot org
  2007-12-21 22:17 ` dfranke at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-19  5:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2007-12-19 05:59 -------
Fixed on trunk


-- 

jvdelisle at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (3 preceding siblings ...)
  2007-12-19  5:55 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-19  5:59 ` jvdelisle at gcc dot gnu dot org
  2007-12-19  5:59 ` jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-12-19  5:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2007-12-19 05:59 -------
Subject: Bug 34325

Author: jvdelisle
Date: Wed Dec 19 05:58:53 2007
New Revision: 131053

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131053
Log:
2007-12-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR fortran/34325
        * gfortran.dg/missing_parens_1.f90: New.
        * gfortran.dg/missing_parens_1.f90: New.

Added:
    trunk/gcc/testsuite/gfortran.dg/missing_parens_1.f90
    trunk/gcc/testsuite/gfortran.dg/missing_parens_2.f90
Modified:
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (5 preceding siblings ...)
  2007-12-19  5:59 ` jvdelisle at gcc dot gnu dot org
@ 2007-12-21 22:17 ` dfranke at gcc dot gnu dot org
  2008-01-23 22:32 ` terry at chem dot gu dot se
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-12-21 22:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dfranke at gcc dot gnu dot org  2007-12-21 22:17 -------
*** Bug 24759 has been marked as a duplicate of this bug. ***


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schnetter at aei dot mpg dot
                   |                            |de


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (6 preceding siblings ...)
  2007-12-21 22:17 ` dfranke at gcc dot gnu dot org
@ 2008-01-23 22:32 ` terry at chem dot gu dot se
  2008-01-23 23:21 ` terry at chem dot gu dot se
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: terry at chem dot gu dot se @ 2008-01-23 22:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from terry at chem dot gu dot se  2008-01-23 21:54 -------
Rather than open a new bug, I'll tack onto this one as it's pretty much the
same bug in a different context.

The latest gfortran does indeed give a sensible error for the test case above.

However, if we put something like:

real(kind=8),dimension(1))::r2

into that code, we still get strange and bizarre errors:

aa.f90:4.13:

real(kind=8),dimension(1))::r2
            1
Error: Invalid character in name at (1)

This is with 4.3.0 20080118.


-- 

terry at chem dot gu dot se changed:

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


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (7 preceding siblings ...)
  2008-01-23 22:32 ` terry at chem dot gu dot se
@ 2008-01-23 23:21 ` terry at chem dot gu dot se
  2008-02-16  5:15 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: terry at chem dot gu dot se @ 2008-01-23 23:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from terry at chem dot gu dot se  2008-01-23 23:00 -------
Actually, with bad parentheses it's easy to generate strange error messages:



do while ((.true.)
           1
Error: Invalid character in name at (1)


do while (.true.
1
Error: Unclassifiable statement at (1)



Yes, these are trivial examples.  But they demonstrate that new
gfc_match_parens either doesn't work very well, or isn't being called in the
right place.


-- 


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (8 preceding siblings ...)
  2008-01-23 23:21 ` terry at chem dot gu dot se
@ 2008-02-16  5:15 ` jvdelisle at gcc dot gnu dot org
  2008-05-16 16:45 ` jvdelisle at gcc dot gnu dot org
  2008-05-16 16:48 ` jvdelisle at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-16  5:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2008-02-16 05:15 -------
Reply to comment #9.  The new function is only being used in one place at the
moment.  We have to apply it case by case, and frankly, "handling" invalid
Fortran code is lower on the priority at the moment.  We'll keep this open
though.


-- 


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (9 preceding siblings ...)
  2008-02-16  5:15 ` jvdelisle at gcc dot gnu dot org
@ 2008-05-16 16:45 ` jvdelisle at gcc dot gnu dot org
  2008-05-16 16:48 ` jvdelisle at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-05-16 16:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2008-05-16 16:45 -------
Subject: Bug 34325

Author: jvdelisle
Date: Fri May 16 16:44:28 2008
New Revision: 135428

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135428
Log:
2008-05-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

    PR fortran/34325
    * decl.c (match_attr_spec): Check for matching pairs of parenthesis.
    * expr.c (gfc_specification_expr): Supplement the error message with the
    type that was found.
    * resolve.c (gfc_resolve_index): Likewise.
    * match.c (gfc_match_parens): Clarify error message with "at or before".
    (gfc_match_do): Check for matching pairs of parenthesis.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/resolve.c


-- 


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


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

* [Bug fortran/34325] Wrong error message for syntax error
  2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
                   ` (10 preceding siblings ...)
  2008-05-16 16:45 ` jvdelisle at gcc dot gnu dot org
@ 2008-05-16 16:48 ` jvdelisle at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-05-16 16:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jvdelisle at gcc dot gnu dot org  2008-05-16 16:47 -------
Closing this.  I doubt we can get them all but this gets quite a few more


-- 

jvdelisle at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-05-16 16:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-03 12:27 [Bug fortran/34325] New: Wrong error message for syntax error terry at chem dot gu dot se
2007-12-06  3:52 ` [Bug fortran/34325] " jvdelisle at gcc dot gnu dot org
2007-12-10  3:15 ` jvdelisle at gcc dot gnu dot org
2007-12-14 19:22 ` jvdelisle at gcc dot gnu dot org
2007-12-19  5:55 ` jvdelisle at gcc dot gnu dot org
2007-12-19  5:59 ` jvdelisle at gcc dot gnu dot org
2007-12-19  5:59 ` jvdelisle at gcc dot gnu dot org
2007-12-21 22:17 ` dfranke at gcc dot gnu dot org
2008-01-23 22:32 ` terry at chem dot gu dot se
2008-01-23 23:21 ` terry at chem dot gu dot se
2008-02-16  5:15 ` jvdelisle at gcc dot gnu dot org
2008-05-16 16:45 ` jvdelisle at gcc dot gnu dot org
2008-05-16 16:48 ` jvdelisle 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).