[Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Jan 24 22:25:00 GMT 2015
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.
More information about the Gcc-bugs
mailing list