public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/19425] New: Duplicate SAVE attribute problem
@ 2005-01-13 14:26 tow21 at cam dot ac dot uk
  2005-01-13 14:59 ` [Bug fortran/19425] " tow21 at cam dot ac dot uk
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: tow21 at cam dot ac dot uk @ 2005-01-13 14:26 UTC (permalink / raw)
  To: gcc-bugs

Consider the following program: 
parabrisas:~/test% cat C578.f  
      subroutine s( ) 
      logical frstme 
      save frstme 
      save 
      continue 
      end 
 
Under constraint C578 of the f95 standard this is illegal, since a global save 
is not permitted in the same scoping unit as any other explicit use of the 
save attribute or save statement. gfortran correctly recognises this and 
diagnoses an error. 
 
However, this constraint did not exist in F77 (I am unsure about F90). 
Therefore, the above is a perfectly legal F77 program (and, indeed g77 
compiles it without complaint).

-- 
           Summary: Duplicate SAVE attribute problem
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tow21 at cam dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
  2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
@ 2005-01-13 14:59 ` tow21 at cam dot ac dot uk
  2005-01-14 23:41 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: tow21 at cam dot ac dot uk @ 2005-01-13 14:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tow21 at cam dot ac dot uk  2005-01-13 14:59 -------
Brief correction - the reference to C578 is actually from the F2003 standard. 
In f95 is it is the second, unnumbered, constraint in section 5.2.4. 

-- 


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
  2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
  2005-01-13 14:59 ` [Bug fortran/19425] " tow21 at cam dot ac dot uk
@ 2005-01-14 23:41 ` pinskia at gcc dot gnu dot org
  2005-02-13 14:59 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-14 23:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-14 23:41 -------
f90 has the same constraint as f95 at least that is what ICC reports.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
  2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
  2005-01-13 14:59 ` [Bug fortran/19425] " tow21 at cam dot ac dot uk
  2005-01-14 23:41 ` pinskia at gcc dot gnu dot org
@ 2005-02-13 14:59 ` pinskia at gcc dot gnu dot org
  2005-03-22 18:36 ` kargl at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-13 14:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-02-12 23:19 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-12 23:19:15
               date|                            |


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
  2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2005-02-13 14:59 ` pinskia at gcc dot gnu dot org
@ 2005-03-22 18:36 ` kargl at gcc dot gnu dot org
  2005-05-06 13:08 ` Konrad dot Bernloehr at mpi-hd dot mpg dot de
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: kargl at gcc dot gnu dot org @ 2005-03-22 18:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kargl at gcc dot gnu dot org  2005-03-22 18:36 -------
Fortran 77 also forbids the behavior.  It looks like the
code is illegal, and g77 contains a bug.

-- 


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
  2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2005-03-22 18:36 ` kargl at gcc dot gnu dot org
@ 2005-05-06 13:08 ` Konrad dot Bernloehr at mpi-hd dot mpg dot de
  2005-05-06 13:22 ` tow21 at cam dot ac dot uk
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Konrad dot Bernloehr at mpi-hd dot mpg dot de @ 2005-05-06 13:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Konrad dot Bernloehr at mpi-hd dot mpg dot de  2005-05-06 13:08 -------
In the Fortran 77 standard (ANSI X3.9-1978) I could not find any sentence that
indicates that a SAVE statement without a list cannot appear in the same program
unit as a SAVE statement with a list of variables. I would conclude that
gfortran does NOT compile valid F77 code. Code which, by the way, is not only
compiled by
g77 but by commercial compilers as well.

Please be more specific if you think that I am wrong.



-- 


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
  2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2005-05-06 13:08 ` Konrad dot Bernloehr at mpi-hd dot mpg dot de
@ 2005-05-06 13:22 ` tow21 at cam dot ac dot uk
  2005-05-07 15:56 ` tobi at gcc dot gnu dot org
  2005-09-18  5:36 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: tow21 at cam dot ac dot uk @ 2005-05-06 13:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tow21 at cam dot ac dot uk  2005-05-06 13:21 -------
(In reply to comment #5) 
> In the Fortran 77 standard (ANSI X3.9-1978) I could not find any sentence 
that 
> indicates that a SAVE statement without a list cannot appear in the same 
program 
> unit as a SAVE statement with a list of variables. 
> [snip] 
> Please be more specific if you think that I am wrong. 
 
Please see the thread on the gfortran mailing list, starting at 
<URL:http://gcc.gnu.org/ml/fortran/2005-03/msg00372.html> 
 
The definitive answer is probably Richard Maine's at: 
<URL:http://gcc.gnu.org/ml/fortran/2005-03/msg00410.html> 
 
In brief, the code is almost certainly illegal - but since g77 compiles it (as 
do several other compilers), it is a clear regression for gfortran to not 
allow its compilation (albeit not under -std=f95) 
 

-- 


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
  2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
                   ` (5 preceding siblings ...)
  2005-05-06 13:22 ` tow21 at cam dot ac dot uk
@ 2005-05-07 15:56 ` tobi at gcc dot gnu dot org
  2005-09-18  5:36 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-05-07 15:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From tobi at gcc dot gnu dot org  2005-05-07 15:56 -------
*** Bug 21434 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joe at confucius dot
                   |                            |gnacademy dot org


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
  2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
                   ` (6 preceding siblings ...)
  2005-05-07 15:56 ` tobi at gcc dot gnu dot org
@ 2005-09-18  5:36 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-18  5:36 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |19292
              nThis|                            |
           Severity|minor                       |enhancement
           Keywords|                            |diagnostic
   Last reconfirmed|2005-02-12 23:19:15         |2005-09-18 05:35:52
               date|                            |


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


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

* [Bug fortran/19425] Duplicate SAVE attribute problem
       [not found] <bug-19425-7575@http.gcc.gnu.org/bugzilla/>
@ 2005-10-24 15:09 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-24 15:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pinskia at gcc dot gnu dot org  2005-10-24 15:09 -------
Fixed for 4.1 by:
        fortran/
        * decl.c (gfc_match_save): Changed duplicate SAVE errors to
        warnings in the absence of strict standard conformance
        * symbol.c (gfc_add_save): Same.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.0


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


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

end of thread, other threads:[~2005-10-24 15:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-13 14:26 [Bug fortran/19425] New: Duplicate SAVE attribute problem tow21 at cam dot ac dot uk
2005-01-13 14:59 ` [Bug fortran/19425] " tow21 at cam dot ac dot uk
2005-01-14 23:41 ` pinskia at gcc dot gnu dot org
2005-02-13 14:59 ` pinskia at gcc dot gnu dot org
2005-03-22 18:36 ` kargl at gcc dot gnu dot org
2005-05-06 13:08 ` Konrad dot Bernloehr at mpi-hd dot mpg dot de
2005-05-06 13:22 ` tow21 at cam dot ac dot uk
2005-05-07 15:56 ` tobi at gcc dot gnu dot org
2005-09-18  5:36 ` pinskia at gcc dot gnu dot org
     [not found] <bug-19425-7575@http.gcc.gnu.org/bugzilla/>
2005-10-24 15:09 ` 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).