This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30284] ICE in gfc_add_modify with internal reads
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Dec 2006 05:25:13 -0000
- Subject: [Bug fortran/30284] ICE in gfc_add_modify with internal reads
- References: <bug-30284-6318@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-12-24 05:25 -------
Reduced testcase:
program gfcbug51
type date_t
character(len=12) :: date
end type date_t
type(date_t) :: file(1)
read (file%date(1:4),'(i4)') a
end program gfcbug51
------------------------------
Here is a patch which fixes the issue too:
Index: trans-io.c
===================================================================
--- trans-io.c (revision 120165)
+++ trans-io.c (working copy)
@@ -635,7 +635,7 @@ set_internal_unit (stmtblock_t * block,
/* The cast is needed for character substrings and the descriptor
data. */
gfc_add_modify_expr (&se.pre, io, fold_convert (TREE_TYPE (io), tmp));
- gfc_add_modify_expr (&se.pre, len, se.string_length);
+ gfc_add_modify_expr (&se.pre, len, fold_convert (TREE_TYPE (len),
se.string_length));
gfc_add_modify_expr (&se.pre, desc, se.expr);
gfc_add_block_to_block (block, &se.pre);
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-valid-code
Last reconfirmed|0000-00-00 00:00:00 |2006-12-24 05:25:13
date| |
Summary|ICE in gfc_add_modify, at |ICE in gfc_add_modify with
|fortran/trans.c:159 |internal reads
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30284