This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 24 Jan 2015 22:25:02 +0000
- Subject: [Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
- Auto-submitted: auto-generated
- References: <bug-64757-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64757
--- Comment #6 from janus at gcc dot gnu.org ---
The following is sufficient to get rid of the ICE:
Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c (Revision 220084)
+++ gcc/fortran/trans-expr.c (Arbeitskopie)
@@ -6490,6 +6490,8 @@ gfc_trans_subcomponent_assign (tree dest, gfc_comp
routine below is motivated by the alloc_scalar_allocatable_for_
assignment() routine, but with the realloc portions removed and
different input. */
+ if (cm->ts.type == BT_CLASS)
+ dest = gfc_class_data_get (dest);
alloc_scalar_allocatable_for_subcomponent_assignment (&block,
dest,
cm,
However, one needs to do more to get the correct run-time behavior: The _vptr
needs to be set for the class component and one needs to use the correct size
for the memory allocation.