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/55072] [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type


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)


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