public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30878]  New: incorrect error message for valid code
@ 2007-02-20  7:52 jv244 at cam dot ac dot uk
  2007-02-20 15:59 ` [Bug fortran/30878] Rejects function f1; namelist /nml/ f1 burnus at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jv244 at cam dot ac dot uk @ 2007-02-20  7:52 UTC (permalink / raw)
  To: gcc-bugs

With recent trunk, gfortran incorrectly generates an error for the following
standard code:
 MODULE M1
 CONTAINS
   INTEGER FUNCTION F1()
     NAMELIST /NML/ F1
     F1=1
   END FUNCTION
   INTEGER FUNCTION F2()
     F2=1
   END FUNCTION
 END MODULE
 END


-- 
           Summary: incorrect error message for valid code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

* [Bug fortran/30878] Rejects function f1; namelist /nml/ f1
  2007-02-20  7:52 [Bug fortran/30878] New: incorrect error message for valid code jv244 at cam dot ac dot uk
@ 2007-02-20 15:59 ` burnus at gcc dot gnu dot org
  2007-03-23 21:41 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-02-20 15:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2007-02-20 15:59 -------
   INTEGER FUNCTION F1()
     NAMELIST /NML/ F1
is rejected:
     NAMELIST /NML/ F1
                     1
Error: PROCEDURE attribute conflicts with NAMELIST attribute in 'f1' at (1)

I didn't check yet whether this is correct; however, g95 and nagf95 accept it
whereas ifort rejects it ("A function result is not valid in this context").


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
           Keywords|                            |rejects-valid
            Summary|incorrect error message for |Rejects function f1;
                   |valid code                  |namelist /nml/ f1


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


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

* [Bug fortran/30878] Rejects function f1; namelist /nml/ f1
  2007-02-20  7:52 [Bug fortran/30878] New: incorrect error message for valid code jv244 at cam dot ac dot uk
  2007-02-20 15:59 ` [Bug fortran/30878] Rejects function f1; namelist /nml/ f1 burnus at gcc dot gnu dot org
@ 2007-03-23 21:41 ` fxcoudert at gcc dot gnu dot org
  2007-05-08 12:51 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-03-23 21:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-03-23 21:41 -------
There are only two restrictions on the namelist-group-objects, and this one is
not in the list:

C574 (R553) A namelist-group-object shall not be an assumed-size array.
C575 (R552) A namelist-group-object shall not have the PRIVATE attribute if the
namelist-group-name has the PUBLIC attribute.

(PS: when fixing this, someone should check that the two constraints above are
checked)


-- 

fxcoudert 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-03-23 21:41:09
               date|                            |


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


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

* [Bug fortran/30878] Rejects function f1; namelist /nml/ f1
  2007-02-20  7:52 [Bug fortran/30878] New: incorrect error message for valid code jv244 at cam dot ac dot uk
  2007-02-20 15:59 ` [Bug fortran/30878] Rejects function f1; namelist /nml/ f1 burnus at gcc dot gnu dot org
  2007-03-23 21:41 ` fxcoudert at gcc dot gnu dot org
@ 2007-05-08 12:51 ` pault at gcc dot gnu dot org
  2007-05-10  7:15 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-05-08 12:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pault at gcc dot gnu dot org  2007-05-08 13:51 -------
I'll submit a fix tonight.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-03-23 21:41:09         |2007-05-08 13:51:33
               date|                            |


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


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

* [Bug fortran/30878] Rejects function f1; namelist /nml/ f1
  2007-02-20  7:52 [Bug fortran/30878] New: incorrect error message for valid code jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2007-05-08 12:51 ` pault at gcc dot gnu dot org
@ 2007-05-10  7:15 ` patchapp at dberlin dot org
  2007-05-11 11:43 ` pault at gcc dot gnu dot org
  2007-05-11 11:48 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: patchapp at dberlin dot org @ 2007-05-10  7:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from patchapp at dberlin dot org  2007-05-10 08:14 -------
Subject: Bug number PR30878

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg00623.html


-- 


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


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

* [Bug fortran/30878] Rejects function f1; namelist /nml/ f1
  2007-02-20  7:52 [Bug fortran/30878] New: incorrect error message for valid code jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2007-05-10  7:15 ` patchapp at dberlin dot org
@ 2007-05-11 11:43 ` pault at gcc dot gnu dot org
  2007-05-11 11:48 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-05-11 11:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2007-05-11 12:43 -------
Subject: Bug 30878

Author: pault
Date: Fri May 11 11:42:56 2007
New Revision: 124615

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124615
Log:
2007-05-11 Paul Thomas <pault@gcc.gnu.org>

        PR fortran/30878
        * resolve.c (resolve_fl_namelist): It is not an error if the
        namelist element is the result variable of the enclosing
        function.  Search for the symbol in current and all parent
        namespaces for a potential conflict.
        * symbol.c (check_conflict): Remove the conflict between
        'in_namelist' and 'FL_PROCEDURE' because the symbol info
        is not available to exclude function result variables.
        * trans-io.c (nml_get_addr_expr): Use the fake result decl
        if the symbol is an implicit result variable.

2007-05-11 Paul Thomas <pault@gcc.gnu.org>

        PR fortran/30878
        * gfortran.dg/namelist_29.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/namelist_29.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/fortran/trans-io.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/30878] Rejects function f1; namelist /nml/ f1
  2007-02-20  7:52 [Bug fortran/30878] New: incorrect error message for valid code jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2007-05-11 11:43 ` pault at gcc dot gnu dot org
@ 2007-05-11 11:48 ` pault at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-05-11 11:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2007-05-11 12:48 -------
Fixed on trunk

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-20  7:52 [Bug fortran/30878] New: incorrect error message for valid code jv244 at cam dot ac dot uk
2007-02-20 15:59 ` [Bug fortran/30878] Rejects function f1; namelist /nml/ f1 burnus at gcc dot gnu dot org
2007-03-23 21:41 ` fxcoudert at gcc dot gnu dot org
2007-05-08 12:51 ` pault at gcc dot gnu dot org
2007-05-10  7:15 ` patchapp at dberlin dot org
2007-05-11 11:43 ` pault at gcc dot gnu dot org
2007-05-11 11:48 ` pault 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).