public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/24398]  New: gfortran tries to parse a comment in a module
@ 2005-10-16  1:14 denney at seas dot upenn dot edu
  2005-10-16  1:15 ` [Bug fortran/24398] " denney at seas dot upenn dot edu
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: denney at seas dot upenn dot edu @ 2005-10-16  1:14 UTC (permalink / raw)
  To: gcc-bugs

When I try to build a program that uses a module that I created with a comment
on the third line, it tries to interpret the comment and gives the error:

$ gfortran llnew.f90 -o llnew
Fatal Error: Reading module numberlists at line 3 column 4: Bad name

Line 3 should be just a comment.  I'm attaching the llnew.f90 code and the
numberlists.mod files.

This occurs on Debian testing with the current version.  In the current version
that is built for windows (GNU Fortran 95 (GCC 4.1.0 20050902 (experimental))),
it gives an ICE:

Fatal Error: Reading module number_lists at line 3 column 4: Bad name
gfortran: Internal error: Aborted (program f951)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: gfortran tries to parse a comment in a module
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: denney at seas dot upenn dot edu


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


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

* [Bug fortran/24398] gfortran tries to parse a comment in a module
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
@ 2005-10-16  1:15 ` denney at seas dot upenn dot edu
  2005-10-16  1:15 ` denney at seas dot upenn dot edu
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: denney at seas dot upenn dot edu @ 2005-10-16  1:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from denney at seas dot upenn dot edu  2005-10-16 01:15 -------
Created an attachment (id=9997)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9997&action=view)
Error where line 4 is a comment


-- 


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


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

* [Bug fortran/24398] gfortran tries to parse a comment in a module
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
  2005-10-16  1:15 ` [Bug fortran/24398] " denney at seas dot upenn dot edu
@ 2005-10-16  1:15 ` denney at seas dot upenn dot edu
  2005-10-16  1:19 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: denney at seas dot upenn dot edu @ 2005-10-16  1:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from denney at seas dot upenn dot edu  2005-10-16 01:14 -------
Created an attachment (id=9996)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9996&action=view)
no errors in this source, but it uses the module


-- 


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


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

* [Bug fortran/24398] gfortran tries to parse a comment in a module
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
  2005-10-16  1:15 ` [Bug fortran/24398] " denney at seas dot upenn dot edu
  2005-10-16  1:15 ` denney at seas dot upenn dot edu
@ 2005-10-16  1:19 ` pinskia at gcc dot gnu dot org
  2005-10-16  1:26 ` denney at seas dot upenn dot edu
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16  1:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2005-10-16 01:19 -------
Can you attach the .f90 file which contains the module numberlists?


-- 


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


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

* [Bug fortran/24398] gfortran tries to parse a comment in a module
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (2 preceding siblings ...)
  2005-10-16  1:19 ` pinskia at gcc dot gnu dot org
@ 2005-10-16  1:26 ` denney at seas dot upenn dot edu
  2005-10-16  1:34 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: denney at seas dot upenn dot edu @ 2005-10-16  1:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from denney at seas dot upenn dot edu  2005-10-16 01:26 -------
(In reply to comment #3)
> Can you attach the .f90 file which contains the module numberlists?
> 

You're too quick for me.  I was in the process of attaching it.  It's there
now.


-- 


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


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

* [Bug fortran/24398] gfortran tries to parse a comment in a module
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (3 preceding siblings ...)
  2005-10-16  1:26 ` denney at seas dot upenn dot edu
@ 2005-10-16  1:34 ` pinskia at gcc dot gnu dot org
  2005-10-16  1:40 ` denney at seas dot upenn dot edu
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16  1:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-10-16 01:33 -------
Oh, I noticed what you did now.

You are not compiling the module but have it named numberlists.mod.

Change the filename of numberlists.mod to numberlists.f90.

And try: gfortran numberlists.f90 llnew.f90 -o llnew
That should work.


-- 


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


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

* [Bug fortran/24398] gfortran tries to parse a comment in a module
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (4 preceding siblings ...)
  2005-10-16  1:34 ` pinskia at gcc dot gnu dot org
@ 2005-10-16  1:40 ` denney at seas dot upenn dot edu
  2005-10-16  6:01 ` jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: denney at seas dot upenn dot edu @ 2005-10-16  1:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from denney at seas dot upenn dot edu  2005-10-16 01:40 -------
Perhaps a better error message than

Fatal Error: Reading module numberlists at line 3 column 4: Bad name

would be

Fatal Error: Reading module numberlists at line 3 column 4: Bad name (perhaps
not a compiled module file)


-- 


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


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

* [Bug fortran/24398] gfortran tries to parse a comment in a module
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (5 preceding siblings ...)
  2005-10-16  1:40 ` denney at seas dot upenn dot edu
@ 2005-10-16  6:01 ` jvdelisle at gcc dot gnu dot org
  2005-11-01 19:50 ` [Bug fortran/24398] invalid module file gives weird error tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2005-10-16  6:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jvdelisle at gcc dot gnu dot org  2005-10-16 06:01 -------
Even better would be if gfortran recognized that the file was not a valid mod
at all and just states "Module file invalid".  Of course users have to know
they do not edit 'mod' files, only source files.


-- 


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


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

* [Bug fortran/24398] invalid module file gives weird error
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (6 preceding siblings ...)
  2005-10-16  6:01 ` jvdelisle at gcc dot gnu dot org
@ 2005-11-01 19:50 ` tobi at gcc dot gnu dot org
  2006-10-05 21:20 ` pault at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-11-01 19:50 UTC (permalink / raw)
  To: gcc-bugs



-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobi at gcc dot gnu dot org
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-01 19:50:33
               date|                            |
            Summary|gfortran tries to parse a   |invalid module file gives
                   |comment in a module         |weird error


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


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

* [Bug fortran/24398] invalid module file gives weird error
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (7 preceding siblings ...)
  2005-11-01 19:50 ` [Bug fortran/24398] invalid module file gives weird error tobi at gcc dot gnu dot org
@ 2006-10-05 21:20 ` pault at gcc dot gnu dot org
  2006-10-06  3:08 ` kargl at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-05 21:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pault at gcc dot gnu dot org  2006-10-05 21:20 -------
Created an attachment (id=12388)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12388&action=view)
A fix for this PR

This checks for the presence of "GFORTRAN module" as the first utterances in
the .mod file.  The error message on this not being so is evident in the patch
and is even understandable. *sigh*

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


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


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

* [Bug fortran/24398] invalid module file gives weird error
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (8 preceding siblings ...)
  2006-10-05 21:20 ` pault at gcc dot gnu dot org
@ 2006-10-06  3:08 ` kargl at gcc dot gnu dot org
  2006-10-13 12:52 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kargl at gcc dot gnu dot org @ 2006-10-06  3:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from kargl at gcc dot gnu dot org  2006-10-06 03:08 -------
Paul,

I read the patch, and think that you can commit it.
gfortran certainly can't recover for a mangled module.


-- 


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


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

* [Bug fortran/24398] invalid module file gives weird error
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (9 preceding siblings ...)
  2006-10-06  3:08 ` kargl at gcc dot gnu dot org
@ 2006-10-13 12:52 ` pault at gcc dot gnu dot org
  2006-10-14  8:20 ` pault at gcc dot gnu dot org
  2006-11-06 17:19 ` pault at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-13 12:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pault at gcc dot gnu dot org  2006-10-13 12:51 -------
Subject: Bug 24398

Author: pault
Date: Fri Oct 13 12:51:07 2006
New Revision: 117692

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117692
Log:
2006-10-13 Paul Thomas <pault@gcc.gnu.org>

        PR fortran/29373
        * decl.c (get_proc_name, gfc_match_function_decl): Add
        attr.implicit_type to conditions that throw error for
        existing explicit interface and that allow new type-
        spec to be applied.

        PR fortran/29407
        * resolve.c (resolve_fl_namelist): Do not check for
        namelist/procedure conflict, if the symbol corresponds
        to a good local variable declaration.

        PR fortran/27701
        * decl.c (get_proc_name): Replace the detection of a declared
        procedure by the presence of a formal argument list by the
        attributes of the symbol and the presence of an explicit
        interface.

        PR fortran/29232
        * resolve.c (resolve_fl_variable): See if the host association
        of a derived type is blocked by the presence of another type I
        object in the current namespace.

        PR fortran/29364
        * resolve.c (resolve_fl_derived): Check for the presence of
        the derived type for a derived type component.

        PR fortran/24398
        * module.c (gfc_use_module): Check that the first words in a
        module file are 'GFORTRAN module'.

        PR fortran/29422
        * resolve.c (resolve_transfer): Test functions for suitability
        for IO, as well as variables.

        PR fortran/29428
        * trans-expr.c (gfc_trans_scalar_assign): Remove nullify of
        rhs expression.


2006-10-13 Paul Thomas <pault@gcc.gnu.org>

        PR fortran/29373
        * gfortran.dg/implicit_9.f90: New test.

        PR fortran/29407
        * gfortran.dg/namelist_25.f90: New test.

        PR fortran/27701
        * gfortran.dg/same_name_2.f90: New test.

        PR fortran/29232
        * gfortran.dg/host_assoc_types_1.f90: New test.

        PR fortran/29364
        * gfortran.dg/missing_derived_type_1.f90: New test.
        * gfortran.dg/implicit_actual.f90: Comment out USE GLOBAL.

        PR fortran/29422
        * gfortran.dg/alloc_comp_constraint_4.f90: New test.

        PR fortran/29428
        * gfortran.dg/alloc_comp_assign_5.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/alloc_comp_assign_5.f90
    trunk/gcc/testsuite/gfortran.dg/alloc_comp_constraint_4.f90
    trunk/gcc/testsuite/gfortran.dg/host_assoc_types_1.f90
    trunk/gcc/testsuite/gfortran.dg/implicit_9.f90
    trunk/gcc/testsuite/gfortran.dg/missing_derived_type_1.f90
    trunk/gcc/testsuite/gfortran.dg/namelist_25.f90
    trunk/gcc/testsuite/gfortran.dg/same_name_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/module.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/implicit_actual.f90


-- 


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


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

* [Bug fortran/24398] invalid module file gives weird error
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (10 preceding siblings ...)
  2006-10-13 12:52 ` pault at gcc dot gnu dot org
@ 2006-10-14  8:20 ` pault at gcc dot gnu dot org
  2006-11-06 17:19 ` pault at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-10-14  8:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pault at gcc dot gnu dot org  2006-10-14 08:20 -------
Fixed in 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=24398


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

* [Bug fortran/24398] invalid module file gives weird error
  2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
                   ` (11 preceding siblings ...)
  2006-10-14  8:20 ` pault at gcc dot gnu dot org
@ 2006-11-06 17:19 ` pault at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-11-06 17:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from pault at gcc dot gnu dot org  2006-11-06 17:18 -------
Subject: Bug 24398

Author: pault
Date: Mon Nov  6 17:18:03 2006
New Revision: 118522

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


        PR fortran/29373
        * decl.c (get_proc_name, gfc_match_function_decl): Add
        attr.implicit_type to conditions that throw error for
        existing explicit interface and that allow new type-
        spec to be applied.

        PR fortran/29407
        * resolve.c (resolve_fl_namelist): Do not check for
        namelist/procedure conflict, if the symbol corresponds
        to a good local variable declaration.

        PR fortran/27701
        * decl.c (get_proc_name): Replace the detection of a declared
        procedure by the presence of a formal argument list by the
        attributes of the symbol and the presence of an explicit
        interface.

        PR fortran/29232
        * resolve.c (resolve_fl_variable): See if the host association
        of a derived type is blocked by the presence of another type I
        object in the current namespace.

        PR fortran/29364
        * resolve.c (resolve_fl_derived): Check for the presence of
        the derived type for a derived type component.

        PR fortran/24398
        * module.c (gfc_use_module): Check that the first words in a
        module file are 'GFORTRAN module'.

        PR fortran/29115
        * resolve.c (resolve_structure_cons): It is an error if the
        pointer component elements of a derived type constructor are
        not pointer or target.

        PR fortran/29211
        * trans-stmt.c (generate_loop_for_temp_to_lhs,
        generate_loop_for_rhs_to_temp): Provide a string length for
        the temporary by copying that of the other side of the scalar
        assignment.

        PR fortran/29098
        * resolve.c (resolve_structure_cons): Do not return FAILURE if
        component expression is NULL.


2006-11-06  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29373
        * gfortran.dg/implicit_9.f90: New test.

        PR fortran/29407
        * gfortran.dg/namelist_25.f90: New test.

        PR fortran/27701
        * gfortran.dg/same_name_2.f90: New test.

        PR fortran/29232
        * gfortran.dg/host_assoc_types_1.f90: New test.

        PR fortran/29364
        * gfortran.dg/missing_derived_type_1.f90: New test.
        * gfortran.dg/implicit_actual.f90: Comment out USE GLOBAL.

        PR fortran/29115
        * gfortran.dg/derived_constructor_comps_2.f90: New test.

        PR fortran/29211
        * gfortran.dg/forall_char_dependencies_1.f90: New test.

        PR fortran/29098
        * gfortran.dg/default_initialization_2.f90: New test.

Added:
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/default_initialization_2.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/derived_constructor_comps_2.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/forall_char_dependencies_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/host_assoc_types_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/implicit_9.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/missing_derived_type_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/namelist_25.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/same_name_2.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/decl.c
    branches/gcc-4_1-branch/gcc/fortran/module.c
    branches/gcc-4_1-branch/gcc/fortran/resolve.c
    branches/gcc-4_1-branch/gcc/fortran/trans-stmt.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/implicit_actual.f90


-- 


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


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

end of thread, other threads:[~2006-11-06 17:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-16  1:14 [Bug fortran/24398] New: gfortran tries to parse a comment in a module denney at seas dot upenn dot edu
2005-10-16  1:15 ` [Bug fortran/24398] " denney at seas dot upenn dot edu
2005-10-16  1:15 ` denney at seas dot upenn dot edu
2005-10-16  1:19 ` pinskia at gcc dot gnu dot org
2005-10-16  1:26 ` denney at seas dot upenn dot edu
2005-10-16  1:34 ` pinskia at gcc dot gnu dot org
2005-10-16  1:40 ` denney at seas dot upenn dot edu
2005-10-16  6:01 ` jvdelisle at gcc dot gnu dot org
2005-11-01 19:50 ` [Bug fortran/24398] invalid module file gives weird error tobi at gcc dot gnu dot org
2006-10-05 21:20 ` pault at gcc dot gnu dot org
2006-10-06  3:08 ` kargl at gcc dot gnu dot org
2006-10-13 12:52 ` pault at gcc dot gnu dot org
2006-10-14  8:20 ` pault at gcc dot gnu dot org
2006-11-06 17:19 ` 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).