public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/17229] New: parser confused by arithmetic if inside an if
@ 2004-08-29 15:14 bdavis at gcc dot gnu dot org
  2004-08-29 17:16 ` [Bug fortran/17229] " tobi at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: bdavis at gcc dot gnu dot org @ 2004-08-29 15:14 UTC (permalink / raw)
  To: gcc-bugs

reduced example to demonstrate:

$ cat z.f
      INTEGER INCX
      INTEGER INCY
      IF (INCX.EQ.INCY) IF (INCX-1) 5,20,60
 5    CONTINUE
 20   CONTINUE
 60   CONTINUE
      END
$ gfc z.f
 In file z.f:3
 
      IF (INCX.EQ.INCY) IF (INCX-1) 5,20,60
                       1
Error: Unclassifiable statement in IF-clause at (1)
 In file z.f:4
 
 5    CONTINUE
 1
Warning: Label 5 at (1) defined but not used
 In file z.f:5
 
 20   CONTINUE
  1
Warning: Label 20 at (1) defined but not used
 In file z.f:6
 
 60   CONTINUE
  1
Warning: Label 60 at (1) defined but not used
$ gfc --version
GNU Fortran 95 (GCC 3.5.0 20040829 (experimental))
Copyright (C) 2003 Free Software Foundation, Inc.
 
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING


works under g77:

$ g77 z.f

-- 
           Summary: parser confused by arithmetic if inside an if
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bdavis at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
@ 2004-08-29 17:16 ` tobi at gcc dot gnu dot org
  2004-11-19 15:17 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-08-29 17:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2004-08-29 17:16 -------
The standard has the following (I'm quoting the Fortran 90 standard, I assume
something similar is in F95, but Fortran 90 is the last standard to contain the
arithmetic if statement):

R807 if-stmt is IF (...) action-stmt
Constraint: The action-stmt must not be an if-stmt, end-progranm-stmt, ...

arithmetic-if-stmt and if-then-stmt are not action-stmts. So we rightfully
reject this code and its sibling
if (.true.) if (cond) then
 ...
end if

As a workaround there's .AND., so I don't think this bug should be a priority.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-29 17:16:46
               date|                            |


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
  2004-08-29 17:16 ` [Bug fortran/17229] " tobi at gcc dot gnu dot org
@ 2004-11-19 15:17 ` pinskia at gcc dot gnu dot org
  2005-01-06 14:42 ` tobi at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-19 15:17 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-19 15:17 -------
*** Bug 18561 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paul dot richard dot thomas
                   |                            |at cea dot fr


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
  2004-08-29 17:16 ` [Bug fortran/17229] " tobi at gcc dot gnu dot org
  2004-11-19 15:17 ` pinskia at gcc dot gnu dot org
@ 2005-01-06 14:42 ` tobi at gcc dot gnu dot org
  2005-04-06 12:38 ` fxcoudert at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-01-06 14:42 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |19292
              nThis|                            |


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-01-06 14:42 ` tobi at gcc dot gnu dot org
@ 2005-04-06 12:38 ` fxcoudert at gcc dot gnu dot org
  2005-04-06 13:22 ` prthomas at drfccad dot cea dot fr
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-04-06 12:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-04-06 12:38 -------
But then, some scientific libraries are using it (I was about to report the same
bug when a search pointed to this one). And since it works on any compiler I
could find (including g77), I'd change that into a bug (and not enhancement).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
           Severity|enhancement                 |normal
   Last reconfirmed|2004-11-11 05:26:38         |2005-04-06 12:38:33
               date|                            |


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-04-06 12:38 ` fxcoudert at gcc dot gnu dot org
@ 2005-04-06 13:22 ` prthomas at drfccad dot cea dot fr
  2005-04-06 13:52 ` fxcoudert at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: prthomas at drfccad dot cea dot fr @ 2005-04-06 13:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From prthomas at drfccad dot cea dot fr  2005-04-06 13:22 -------
Subject: RE:  parser confused by arithmetic if inside a
	n if


> But then, some scientific libraries are using it (I was about 
> to report the same
> bug when a search pointed to this one). And since it works on 
> any compiler I
> could find (including g77), I'd change that into a bug (and 
> not enhancement).
> 

Neither Tobi not Andrew said that it is not a bug......

Paul


-- 


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-04-06 13:22 ` prthomas at drfccad dot cea dot fr
@ 2005-04-06 13:52 ` fxcoudert at gcc dot gnu dot org
  2005-04-06 14:57 ` fxcoudert at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-04-06 13:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-04-06 13:52 -------
Paul: Before I changed the severity field, it was "enhancement".

All: I was a patch for this one, I will polish the testcase a bit and post it in
a few days.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-04-06 12:38:33         |2005-04-06 13:52:39
               date|                            |


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-04-06 13:52 ` fxcoudert at gcc dot gnu dot org
@ 2005-04-06 14:57 ` fxcoudert at gcc dot gnu dot org
  2005-04-08 10:57 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-04-06 14:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-04-06 14:57 -------
Patch proposed here: http://gcc.gnu.org/ml/fortran/2005-04/msg00104.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-04-06 14:57 ` fxcoudert at gcc dot gnu dot org
@ 2005-04-08 10:57 ` cvs-commit at gcc dot gnu dot org
  2005-04-08 10:57 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-08 10:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-04-08 10:57 -------
Subject: Bug 17229

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	fxcoudert@gcc.gnu.org	2005-04-08 10:57:00

Modified files:
	gcc/fortran    : ChangeLog match.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: pr17229.f 

Log message:
	PR fortran/17229
	
	* match.c (gfc_match_arithmetic_if): New function to match an
	arithmetic IF statement.
	(gfc_match_if): Use gfc_match_arithmetic_if to match an
	arithmetic IF statement embedded in a simple IF statement.
	
	* gfortran.dg/pr17229.f: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.381&r2=1.382
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.c.diff?cvsroot=gcc&r1=1.32&r2=1.33
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5303&r2=1.5304
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pr17229.f.diff?cvsroot=gcc&r1=1.1&r2=1.2



-- 


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2005-04-08 10:57 ` cvs-commit at gcc dot gnu dot org
@ 2005-04-08 10:57 ` cvs-commit at gcc dot gnu dot org
  2005-04-08 11:12 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-08 10:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-04-08 10:57 -------
Subject: Bug 17229

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	fxcoudert@gcc.gnu.org	2005-04-08 10:56:54

Modified files:
	gcc/fortran    : ChangeLog match.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: pr17229.f 

Log message:
	PR fortran/17229
	
	* match.c (gfc_match_arithmetic_if): New function to match an
	arithmetic IF statement.
	(gfc_match_if): Use gfc_match_arithmetic_if to match an
	arithmetic IF statement embedded in a simple IF statement.
	
	* gfortran.dg/pr17229.f: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.31&r2=1.335.2.32
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.31.8.1&r2=1.31.8.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.116&r2=1.5084.2.117
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/pr17229.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2005-04-08 10:57 ` cvs-commit at gcc dot gnu dot org
@ 2005-04-08 11:12 ` fxcoudert at gcc dot gnu dot org
  2005-04-08 11:43 ` pinskia at gcc dot gnu dot org
  2005-04-20  2:48 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-04-08 11:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-04-08 11:11 -------
Fixed.

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


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2005-04-08 11:12 ` fxcoudert at gcc dot gnu dot org
@ 2005-04-08 11:43 ` pinskia at gcc dot gnu dot org
  2005-04-20  2:48 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-08 11:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-08 11:43 -------
*** Bug 20824 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |federico dot carminati at
                   |                            |cern dot ch


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


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

* [Bug fortran/17229] parser confused by arithmetic if inside an if
  2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2005-04-08 11:43 ` pinskia at gcc dot gnu dot org
@ 2005-04-20  2:48 ` pinskia at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-20  2:48 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2005-04-20  2:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-29 15:14 [Bug fortran/17229] New: parser confused by arithmetic if inside an if bdavis at gcc dot gnu dot org
2004-08-29 17:16 ` [Bug fortran/17229] " tobi at gcc dot gnu dot org
2004-11-19 15:17 ` pinskia at gcc dot gnu dot org
2005-01-06 14:42 ` tobi at gcc dot gnu dot org
2005-04-06 12:38 ` fxcoudert at gcc dot gnu dot org
2005-04-06 13:22 ` prthomas at drfccad dot cea dot fr
2005-04-06 13:52 ` fxcoudert at gcc dot gnu dot org
2005-04-06 14:57 ` fxcoudert at gcc dot gnu dot org
2005-04-08 10:57 ` cvs-commit at gcc dot gnu dot org
2005-04-08 10:57 ` cvs-commit at gcc dot gnu dot org
2005-04-08 11:12 ` fxcoudert at gcc dot gnu dot org
2005-04-08 11:43 ` pinskia at gcc dot gnu dot org
2005-04-20  2:48 ` pinskia 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).