public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/35009]  New: error on valid with -std=f95 (character arrays in format tags)
@ 2008-01-29  5:40 bcbarnes at gmail dot com
  2008-01-29 12:34 ` [Bug fortran/35009] " fxcoudert at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: bcbarnes at gmail dot com @ 2008-01-29  5:40 UTC (permalink / raw)
  To: gcc-bugs

from my original report:

I have a program which uses conditional format tags, similar to this testcase
which is taken from page 187 of Metcalf, Reid and Cohen's Fortran 95/2003
explained:

---
      program testcase
      integer :: ival(30),key,i
      character(30) :: buffer
      character(6) :: form2(3) = (/ '(30i1)', '(15i2)', '(10i3)' /)

      read (*, '(a30,i1)') buffer, key
      read (buffer, form2 (key)) (ival(i), i=1,30/key)

      end
---

When compiled with -std=gnu  (gfortran 4.2.2, darwin8), no warning is issued
(which is good).  But when compiled with -std=f95 or -std=f2003, the following
error results:

---
nell:~/work/bit barnes$ gfortran -std=f95 testcase.f
testcase.f:7.19:

      read (buffer, form2 (key)) (ival(i), i=1,30/key)
                  1
Error: Extension: Character array in FORMAT tag at (1)
---


Tobias S. confirmed this as a bug.  I was using gfortran 4.2.2 but this is
probably in 4.3.0 as well.


-- 
           Summary: error on valid with -std=f95 (character arrays in format
                    tags)
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bcbarnes at gmail dot com


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
@ 2008-01-29 12:34 ` fxcoudert at gcc dot gnu dot org
  2008-02-04 23:15 ` fxcoudert at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-01-29 12:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2008-01-29 10:56 -------
Confirmed, also fails on 4.3.0.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
      Known to fail|                            |4.2.2 4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-29 10:56:36
               date|                            |


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
  2008-01-29 12:34 ` [Bug fortran/35009] " fxcoudert at gcc dot gnu dot org
@ 2008-02-04 23:15 ` fxcoudert at gcc dot gnu dot org
  2008-02-09  6:15 ` pault at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-02-04 23:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2008-02-04 23:14 -------
The following code in resolve_tag_format() is wrong:

  /* If e's rank is zero and e is not an element of an array, it should be
     of integer or character type.  The integer variable should be
     ASSIGNED.  */
  if (e->symtree == NULL || e->symtree->n.sym->as == NULL
      || e->symtree->n.sym->as->rank == 0)

We should not check e->symtree->n.sym->as->rank but the expression's rank
(e->rank). I'm not sure that covers everything, though, I may be missing some
corner case that the code above was designed to catch...


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
  2008-01-29 12:34 ` [Bug fortran/35009] " fxcoudert at gcc dot gnu dot org
  2008-02-04 23:15 ` fxcoudert at gcc dot gnu dot org
@ 2008-02-09  6:15 ` pault at gcc dot gnu dot org
  2008-02-13  5:42 ` jvdelisle at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: pault at gcc dot gnu dot org @ 2008-02-09  6:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2008-02-09 06:14 -------
(In reply to comment #2

FX,

I think that your logic is impeccable - I am sure that is the correct fix.

Cheers

Paul


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (2 preceding siblings ...)
  2008-02-09  6:15 ` pault at gcc dot gnu dot org
@ 2008-02-13  5:42 ` jvdelisle at gcc dot gnu dot org
  2008-02-13  6:10 ` jvdelisle at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-13  5:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2008-02-13 05:41 -------
I have tried FX fix and it does the trick.  I am regression testing.  FX if you
can't get to it for 4.4, let me know and i will commit for you.


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (3 preceding siblings ...)
  2008-02-13  5:42 ` jvdelisle at gcc dot gnu dot org
@ 2008-02-13  6:10 ` jvdelisle at gcc dot gnu dot org
  2008-02-13  8:59 ` fxcoudert at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-13  6:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2008-02-13 06:09 -------
The patch causes several regressions.  hollerith.f90 for example.


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (4 preceding siblings ...)
  2008-02-13  6:10 ` jvdelisle at gcc dot gnu dot org
@ 2008-02-13  8:59 ` fxcoudert at gcc dot gnu dot org
  2008-02-28 23:09 ` fxcoudert at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-02-13  8:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from fxcoudert at gcc dot gnu dot org  2008-02-13 08:59 -------
(In reply to comment #5)
> The patch causes several regressions.  hollerith.f90 for example.

I knew I was missing something :)


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (5 preceding siblings ...)
  2008-02-13  8:59 ` fxcoudert at gcc dot gnu dot org
@ 2008-02-28 23:09 ` fxcoudert at gcc dot gnu dot org
  2008-02-29  4:53 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-02-28 23:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from fxcoudert at gcc dot gnu dot org  2008-02-28 23:08 -------
(In reply to comment #6)
> I knew I was missing something :)

I try again... this time, with less ambition, just fix the case at hand... this
should not break anything (but... I can't regtest right now).

Index: io.c
===================================================================
--- io.c        (revision 132578)
+++ io.c        (working copy)
@@ -1148,8 +1148,9 @@
      constant.  */
   if (e->ts.type == BT_CHARACTER)
     {
-      if (gfc_notify_std (GFC_STD_GNU, "Extension: Character array "
-                         "in FORMAT tag at %L", &e->where) == FAILURE)
+      if (e->rank > 0
+         && gfc_notify_std (GFC_STD_GNU, "Extension: Character array "
+                            "in FORMAT tag at %L", &e->where) == FAILURE)
        return FAILURE;
     }
   else


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (6 preceding siblings ...)
  2008-02-28 23:09 ` fxcoudert at gcc dot gnu dot org
@ 2008-02-29  4:53 ` jvdelisle at gcc dot gnu dot org
  2008-03-02 22:31 ` fxcoudert at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-02-29  4:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2008-02-29 04:52 -------
Need to update hollerith.f90 and hollerith_f95.f90, otherwise OK.


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (7 preceding siblings ...)
  2008-02-29  4:53 ` jvdelisle at gcc dot gnu dot org
@ 2008-03-02 22:31 ` fxcoudert at gcc dot gnu dot org
  2008-03-02 23:07 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-03-02 22:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from fxcoudert at gcc dot gnu dot org  2008-03-02 22:31 -------
(In reply to comment #8)
> Need to update hollerith.f90 and hollerith_f95.f90, otherwise OK.

I'm actually not sure at all whether the code in these two testcases is valid
or not... And so, I'm not sure how to proceed :)


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (8 preceding siblings ...)
  2008-03-02 22:31 ` fxcoudert at gcc dot gnu dot org
@ 2008-03-02 23:07 ` jvdelisle at gcc dot gnu dot org
  2008-03-13  5:14 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-03-02 23:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jvdelisle at gcc dot gnu dot org  2008-03-02 23:06 -------
The code is not valid in these test cases. For -std-f95 we give errors. 
Otherwise we always warn and it is allowed as an extension.

The test cases happen to be using an array for the format which is allowed. 
That the array contains Hollerith is irrelevant to what you are fixing here.


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (9 preceding siblings ...)
  2008-03-02 23:07 ` jvdelisle at gcc dot gnu dot org
@ 2008-03-13  5:14 ` jvdelisle at gcc dot gnu dot org
  2009-01-03 22:38 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-03-13  5:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jvdelisle at gcc dot gnu dot org  2008-03-13 05:14 -------
FX, are you OK on this or do you still have a concern?


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (10 preceding siblings ...)
  2008-03-13  5:14 ` jvdelisle at gcc dot gnu dot org
@ 2009-01-03 22:38 ` dfranke at gcc dot gnu dot org
  2009-01-04  6:08 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-01-03 22:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from dfranke at gcc dot gnu dot org  2009-01-03 22:38 -------
Jerry, do you think we can (finally) commit/fix this?


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org, jvdelisle at gcc dot
                   |                            |gnu dot org


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (11 preceding siblings ...)
  2009-01-03 22:38 ` dfranke at gcc dot gnu dot org
@ 2009-01-04  6:08 ` jvdelisle at gcc dot gnu dot org
  2009-10-04 21:18 ` jvdelisle at gcc dot gnu dot org
  2009-10-05  2:49 ` jvdelisle at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-01-04  6:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jvdelisle at gcc dot gnu dot org  2009-01-04 06:08 -------
hmm, forgot all about this.  I will apply the patch, retest, and commit if OK


-- 


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (12 preceding siblings ...)
  2009-01-04  6:08 ` jvdelisle at gcc dot gnu dot org
@ 2009-10-04 21:18 ` jvdelisle at gcc dot gnu dot org
  2009-10-05  2:49 ` jvdelisle at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-10-04 21:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from jvdelisle at gcc dot gnu dot org  2009-10-04 21:18 -------
Yikes, this slipped in the crack.  I am doing triage today and noticed this.
Assigning to myself.


-- 

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|2008-01-29 10:56:36         |2009-10-04 21:18:15
               date|                            |


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


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

* [Bug fortran/35009] error on valid with -std=f95 (character arrays in format tags)
  2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
                   ` (13 preceding siblings ...)
  2009-10-04 21:18 ` jvdelisle at gcc dot gnu dot org
@ 2009-10-05  2:49 ` jvdelisle at gcc dot gnu dot org
  14 siblings, 0 replies; 16+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-10-05  2:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from jvdelisle at gcc dot gnu dot org  2009-10-05 02:49 -------
OK, This got fixed somewhere along the way and the test case provided works
fine.

Closing.


-- 

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=35009


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

end of thread, other threads:[~2009-10-05  2:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-29  5:40 [Bug fortran/35009] New: error on valid with -std=f95 (character arrays in format tags) bcbarnes at gmail dot com
2008-01-29 12:34 ` [Bug fortran/35009] " fxcoudert at gcc dot gnu dot org
2008-02-04 23:15 ` fxcoudert at gcc dot gnu dot org
2008-02-09  6:15 ` pault at gcc dot gnu dot org
2008-02-13  5:42 ` jvdelisle at gcc dot gnu dot org
2008-02-13  6:10 ` jvdelisle at gcc dot gnu dot org
2008-02-13  8:59 ` fxcoudert at gcc dot gnu dot org
2008-02-28 23:09 ` fxcoudert at gcc dot gnu dot org
2008-02-29  4:53 ` jvdelisle at gcc dot gnu dot org
2008-03-02 22:31 ` fxcoudert at gcc dot gnu dot org
2008-03-02 23:07 ` jvdelisle at gcc dot gnu dot org
2008-03-13  5:14 ` jvdelisle at gcc dot gnu dot org
2009-01-03 22:38 ` dfranke at gcc dot gnu dot org
2009-01-04  6:08 ` jvdelisle at gcc dot gnu dot org
2009-10-04 21:18 ` jvdelisle at gcc dot gnu dot org
2009-10-05  2:49 ` 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).