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/55825] [OOP] Bogus rank error with CLASS pointer assignment using structure constructors


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

--- Comment #5 from janus at gcc dot gnu.org 2012-12-28 21:53:38 UTC ---
There are problems with handling CLASS components in
gfc_trans_subcomponent_assign:


Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c    (revision 194743)
+++ gcc/fortran/trans-expr.c    (working copy)
@@ -5934,11 +5934,14 @@ gfc_trans_subcomponent_assign (tree dest, gfc_comp

   gfc_start_block (&block);

-  if (cm->attr.pointer || cm->attr.proc_pointer)
+  if (cm->attr.pointer || cm->attr.proc_pointer
+      || (cm->ts.type == BT_CLASS && CLASS_DATA (cm)->attr.pointer))
     {
       gfc_init_se (&se, NULL);
       /* Pointer component.  */
-      if (cm->attr.dimension && !cm->attr.proc_pointer)
+      if ((cm->attr.dimension
+       || (cm->ts.type == BT_CLASS && CLASS_DATA (cm)->attr.dimension))
+      && !cm->attr.proc_pointer)
     {
       /* Array pointer.  */
       if (expr->expr_type == EXPR_NULL)



However, this is not enough. The test case still gives an ICE.


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