public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45066]  New: ICE in namelist read in snapshot of 7/24/2010
@ 2010-07-25 11:05 michael dot a dot richmond at nasa dot gov
  2010-07-25 14:26 ` [Bug fortran/45066] " jvdelisle at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2010-07-25 11:05 UTC (permalink / raw)
  To: gcc-bugs

When I compile the following file with the snapshot of July 24, 2010:

MODULE GA_commons
INTEGER :: nichflg(2)
END MODULE GA_commons
PROGRAM gafortran
USE GA_commons
NAMELIST /ga/ nichflg
READ (23, nml=ga)
END PROGRAM gafortran

I get the following message:

g.f90: In function gafortran:
g.f90:7:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: ICE in namelist read in snapshot of 7/24/2010
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michael dot a dot richmond at nasa dot gov
 GCC build triplet: all
  GCC host triplet: all
GCC target triplet: all


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


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

* [Bug fortran/45066] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
@ 2010-07-25 14:26 ` jvdelisle at gcc dot gnu dot org
  2010-07-25 15:04 ` jvdelisle at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-25 14:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jvdelisle at gcc dot gnu dot org  2010-07-25 14:26 -------
Confirmed. Works with -fno-whole-file.


-- 

jvdelisle 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         |2010-07-25 14:26:17
               date|                            |


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


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

* [Bug fortran/45066] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
  2010-07-25 14:26 ` [Bug fortran/45066] " jvdelisle at gcc dot gnu dot org
@ 2010-07-25 15:04 ` jvdelisle at gcc dot gnu dot org
  2010-07-25 16:12 ` michael dot a dot richmond at nasa dot gov
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-25 15:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2010-07-25 15:04 -------
This patchlet at least works for the reduce test case. Assuming there is
nothing left to translate.  I am not sure this is the right approach, bu the
-fdump-tree-original matches for with and without -fno-whole-file. 

Index: trans-io.c
===================================================================
--- trans-io.c  (revision 162507)
+++ trans-io.c  (working copy)
@@ -1499,6 +1499,9 @@

   gcc_assert (sym || c);

+  if (base_addr == NULL)
+    return;
+
   /* Build the namelist object name.  */

   string = gfc_build_cstring_const (var_name);


-- 


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


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

* [Bug fortran/45066] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
  2010-07-25 14:26 ` [Bug fortran/45066] " jvdelisle at gcc dot gnu dot org
  2010-07-25 15:04 ` jvdelisle at gcc dot gnu dot org
@ 2010-07-25 16:12 ` michael dot a dot richmond at nasa dot gov
  2010-07-25 16:22 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2010-07-25 16:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from michael dot a dot richmond at nasa dot gov  2010-07-25 16:12 -------
The patchlet also works for the full-size problem (Ga170.f90 from Alan Miller's
ga.zip)


-- 


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


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

* [Bug fortran/45066] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
                   ` (2 preceding siblings ...)
  2010-07-25 16:12 ` michael dot a dot richmond at nasa dot gov
@ 2010-07-25 16:22 ` jvdelisle at gcc dot gnu dot org
  2010-07-25 16:25 ` michael dot a dot richmond at nasa dot gov
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-25 16:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jvdelisle at gcc dot gnu dot org  2010-07-25 16:21 -------
Naturally the patch in #2 breaks everything else for namelists at run time
unless I messed up something else here.


-- 


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


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

* [Bug fortran/45066] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
                   ` (3 preceding siblings ...)
  2010-07-25 16:22 ` jvdelisle at gcc dot gnu dot org
@ 2010-07-25 16:25 ` michael dot a dot richmond at nasa dot gov
  2010-07-25 17:37 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2010-07-25 16:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from michael dot a dot richmond at nasa dot gov  2010-07-25 16:25 -------
At runtime it produces the message:

At line 1200 of file ga170.f90 (unit = 23, file = 'ga.inp')
Fortran runtime error: Missing format for FORMATTED data transfer


-- 


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


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

* [Bug fortran/45066] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
                   ` (4 preceding siblings ...)
  2010-07-25 16:25 ` michael dot a dot richmond at nasa dot gov
@ 2010-07-25 17:37 ` jvdelisle at gcc dot gnu dot org
  2010-07-25 18:01 ` michael dot a dot richmond at nasa dot gov
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-25 17:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2010-07-25 17:37 -------
Here is another possibility.  Only one namelist regression with this on.

Index: trans-io.c
===================================================================
--- trans-io.c  (revision 162507)
+++ trans-io.c  (working copy)
@@ -1759,8 +1759,11 @@ build_dt (tree function, gfc_code * code)
          dt_parm = var;

          for (nml = dt->namelist->namelist; nml; nml = nml->next)
-           transfer_namelist_element (&block, nml->sym->name, nml->sym,
-                                      NULL, NULL);
+           {
+             if (nml->sym->backend_decl)
+               transfer_namelist_element (&block, nml->sym->name, nml->sym,
+                                          NULL, NULL);
+           }
        }
       else
        set_parameter_const (&block, var, IOPARM_common_flags, mask);


-- 


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


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

* [Bug fortran/45066] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
                   ` (5 preceding siblings ...)
  2010-07-25 17:37 ` jvdelisle at gcc dot gnu dot org
@ 2010-07-25 18:01 ` michael dot a dot richmond at nasa dot gov
  2010-07-25 19:33 ` [Bug fortran/45066] [4.6 Regression] " burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2010-07-25 18:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from michael dot a dot richmond at nasa dot gov  2010-07-25 18:01 -------
It compiles but doesn't run, as with your Comment #2 patch


-- 


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


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

* [Bug fortran/45066] [4.6 Regression] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
                   ` (6 preceding siblings ...)
  2010-07-25 18:01 ` michael dot a dot richmond at nasa dot gov
@ 2010-07-25 19:33 ` burnus at gcc dot gnu dot org
  2010-07-26  9:42 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-25 19:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
            Summary|ICE in namelist read in     |[4.6 Regression] ICE in
                   |snapshot of 7/24/2010       |namelist read in snapshot of
                   |                            |7/24/2010
   Target Milestone|---                         |4.6.0


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


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

* [Bug fortran/45066] [4.6 Regression] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
                   ` (7 preceding siblings ...)
  2010-07-25 19:33 ` [Bug fortran/45066] [4.6 Regression] " burnus at gcc dot gnu dot org
@ 2010-07-26  9:42 ` burnus at gcc dot gnu dot org
  2010-07-26 10:31 ` burnus at gcc dot gnu dot org
  2010-07-26 10:32 ` burnus at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-26  9:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from burnus at gcc dot gnu dot org  2010-07-26 09:42 -------
(In reply to comment #2)
> --- trans-io.c  (revision 162507)
> +++ trans-io.c  (working copy)
> +  if (base_addr == NULL)
> +    return;
> +

This does not make sense if you call transfer_namelist_element in build_dt with
the arguments:
            transfer_namelist_element (&block, nml->sym->name, nml->sym,
                                       NULL, NULL);
The last argument is "tree base_addr". (By the way, I think that should be
NULL_TREE and not NULL.)

Besides, the issue seems to be rather:
      dt =  TREE_TYPE ((sym) ? sym->backend_decl : c->backend_decl);
      dtype = gfc_get_dtype (dt);
which makes more sense in terms of fwhole-file; the problem is that
sym->backend_decl = NULL.

It seems as if the following patch fixes this. With -fno-whole-file the
sym->backend_decl is set and one returns the decl. With -fwhole-file only the
decl was returned.

I wonder how many other issues this patch fixes.

Note: I tested it for the example in comment 0, but I have not yet tested it
against gfortran's test suite.


Index: trans-io.c
===================================================================
--- trans-io.c  (revision 162526)
+++ trans-io.c  (working copy)
@@ -1760,7 +1760,7 @@ build_dt (tree function, gfc_code * code

          for (nml = dt->namelist->namelist; nml; nml = nml->next)
            transfer_namelist_element (&block, nml->sym->name, nml->sym,
-                                      NULL, NULL);
+                                      NULL, NULL_TREE);
        }
       else
        set_parameter_const (&block, var, IOPARM_common_flags, mask);
Index: trans-decl.c
===================================================================
--- trans-decl.c        (revision 162526)
+++ trans-decl.c        (working copy)
@@ -1150,7 +1150,8 @@ gfc_get_symbol_decl (gfc_symbol * sym)
                                           true);
              if (sym->ts.type == BT_CHARACTER)
                sym->ts.u.cl->backend_decl = s->ts.u.cl->backend_decl;
-             return s->backend_decl;
+             sym->backend_decl = s->backend_decl;
+             return sym->backend_decl;
            }
        }
     }


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |burnus at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2010-07-25 14:26:17         |2010-07-26 09:42:10
               date|                            |


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


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

* [Bug fortran/45066] [4.6 Regression] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
                   ` (8 preceding siblings ...)
  2010-07-26  9:42 ` burnus at gcc dot gnu dot org
@ 2010-07-26 10:31 ` burnus at gcc dot gnu dot org
  2010-07-26 10:32 ` burnus at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-26 10:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from burnus at gcc dot gnu dot org  2010-07-26 10:31 -------
Subject: Bug 45066

Author: burnus
Date: Mon Jul 26 10:30:45 2010
New Revision: 162532

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162532
Log:
2010-07-26  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45066
        * trans-io.c (build_dt): Use NULL_TREE rather than NULL
        for call to transfer_namelist_element.
        * trans-decl.c (gfc_get_symbol_decl): Also set sym->backend_decl
        for -fwhole-file.

2010-07-26  Tobias Burnus  <burnus@net-b.de>

        PR fortran/45066
        * gfortran.dg/namelist_62.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/namelist_62.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/fortran/trans-io.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/45066] [4.6 Regression] ICE in namelist read in snapshot of 7/24/2010
  2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
                   ` (9 preceding siblings ...)
  2010-07-26 10:31 ` burnus at gcc dot gnu dot org
@ 2010-07-26 10:32 ` burnus at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-26 10:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from burnus at gcc dot gnu dot org  2010-07-26 10:32 -------
(In reply to comment #8)
> I wonder how many other issues this patch fixes.

Seemingly none of those -fwhole-file/-fwhole-program issues which I wanted to
see fixed :-(

Well, at least this PR is now FIXED. Thanks for the bug report!

(As with all -fwhole-file patches: I think I won't backport them to 4.5.
Howvever, if someone wants to do it, feel free to do so.)


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-07-26 10:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-25 11:05 [Bug fortran/45066] New: ICE in namelist read in snapshot of 7/24/2010 michael dot a dot richmond at nasa dot gov
2010-07-25 14:26 ` [Bug fortran/45066] " jvdelisle at gcc dot gnu dot org
2010-07-25 15:04 ` jvdelisle at gcc dot gnu dot org
2010-07-25 16:12 ` michael dot a dot richmond at nasa dot gov
2010-07-25 16:22 ` jvdelisle at gcc dot gnu dot org
2010-07-25 16:25 ` michael dot a dot richmond at nasa dot gov
2010-07-25 17:37 ` jvdelisle at gcc dot gnu dot org
2010-07-25 18:01 ` michael dot a dot richmond at nasa dot gov
2010-07-25 19:33 ` [Bug fortran/45066] [4.6 Regression] " burnus at gcc dot gnu dot org
2010-07-26  9:42 ` burnus at gcc dot gnu dot org
2010-07-26 10:31 ` burnus at gcc dot gnu dot org
2010-07-26 10:32 ` burnus 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).