This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/64757] [5 Regression] ICE in fold_convert_loc, at fold-const.c:2353


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]