[Bug fortran/55072] [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Dec 15 00:19:00 GMT 2012


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

--- Comment #7 from janus at gcc dot gnu.org 2012-12-15 00:18:58 UTC ---
The following patch (which amounts to a partial revert of r156749) fixes the
behavior of comment #2 for me:


Index: gcc/fortran/trans-array.c
===================================================================
--- gcc/fortran/trans-array.c    (revision 194387)
+++ gcc/fortran/trans-array.c    (working copy)
@@ -6957,6 +6957,11 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr *
   ultimate_ptr_comp = false;
   ultimate_alloc_comp = false;

+  if (expr->symtree)
+    ultimate_ptr_comp = expr->symtree->n.sym->ts.type == BT_CLASS
+            ? CLASS_DATA (expr->symtree->n.sym)->attr.class_pointer
+            : expr->symtree->n.sym->attr.pointer;
+
   for (ref = expr->ref; ref; ref = ref->next)
     {
       if (ref->next == NULL)



More information about the Gcc-bugs mailing list