[Bug fortran/45066] [4.6 Regression] ICE in namelist read in snapshot of 7/24/2010

2010-07-26 Thread burnus at gcc dot gnu dot org


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



[Bug fortran/45066] [4.6 Regression] ICE in namelist read in snapshot of 7/24/2010

2010-07-26 Thread burnus at gcc dot gnu dot org


--- 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=gccview=revrev=162532
Log:
2010-07-26  Tobias Burnus  bur...@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  bur...@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



[Bug fortran/45066] [4.6 Regression] ICE in namelist read in snapshot of 7/24/2010

2010-07-26 Thread burnus at gcc dot gnu dot org


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



[Bug fortran/45066] [4.6 Regression] ICE in namelist read in snapshot of 7/24/2010

2010-07-25 Thread burnus at gcc dot gnu dot org


-- 

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