[Bug fortran/54881] [4.8 Regression] [OOP] ICE in fold_convert_loc, at fold-const.c:2016

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 10 16:35:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54881

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #5 from janus at gcc dot gnu.org 2012-10-10 16:35:23 UTC ---
(In reply to comment #4) 
> 1) The ICE in comment 2, which happens with all gfortran versions from 4.5 to
> trunk.

The ICE can be fixed by the following patch:

Index: gcc/fortran/trans-intrinsic.c
===================================================================
--- gcc/fortran/trans-intrinsic.c    (revision 192159)
+++ gcc/fortran/trans-intrinsic.c    (working copy)
@@ -5732,8 +5732,6 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
   gfc_init_se (&arg1se, NULL);
   gfc_init_se (&arg2se, NULL);
   arg1 = expr->value.function.actual;
-  if (arg1->expr->ts.type == BT_CLASS)
-    gfc_add_data_component (arg1->expr);
   arg2 = arg1->next;

   /* Check whether the expression is a scalar or not; we cannot use
@@ -5755,7 +5753,10 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
           && arg1->expr->symtree->n.sym->attr.dummy)
         arg1se.expr = build_fold_indirect_ref_loc (input_location,
                                arg1se.expr);
-      tmp2 = arg1se.expr;
+      if (arg1->expr->ts.type == BT_CLASS)
+          tmp2 = gfc_class_data_get (arg1se.expr);
+      else
+        tmp2 = arg1se.expr;
         }
       else
         {



More information about the Gcc-bugs mailing list