This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/55072] [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 15 Dec 2012 00:18:58 +0000
- Subject: [Bug fortran/55072] [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type
- Auto-submitted: auto-generated
- References: <bug-55072-4@http.gcc.gnu.org/bugzilla/>
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)