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 13:46:26 +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 #11 from janus at gcc dot gnu.org 2012-12-15 13:46:26 UTC ---
Ok, revised version of the patch from comment 9, which fixes the runtime
failure on internal_pack_10.f90:
Index: gcc/fortran/trans-array.c
===================================================================
--- gcc/fortran/trans-array.c (revision 194517)
+++ gcc/fortran/trans-array.c (working copy)
@@ -6995,20 +6995,14 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr *
this_array_result = false;
/* Passing address of the array if it is not pointer or assumed-shape. */
- if (full_array_var && g77 && !this_array_result)
+ if (full_array_var && g77 && !this_array_result
+ && sym->ts.type != BT_DERIVED && sym->ts.type != BT_CLASS)
{
tmp = gfc_get_symbol_decl (sym);
if (sym->ts.type == BT_CHARACTER)
se->string_length = sym->ts.u.cl->backend_decl;
- if (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS)
- {
- gfc_conv_expr_descriptor (se, expr);
- se->expr = gfc_conv_array_data (se->expr);
- return;
- }
-
if (!sym->attr.pointer
&& sym->as
&& sym->as->type != AS_ASSUMED_SHAPE
Note: This still shows scan-tree-dump failures on assumed_type_2.f90, but now
only 2 of them at -O0 (instead of 4):
FAIL: gfortran.dg/assumed_type_2.f90 -O0 scan-tree-dump-times original
"sub_array_assumed \\(D" 2
FAIL: gfortran.dg/assumed_type_2.f90 -O0 scan-tree-dump-times original
"sub_array_assumed \\(\\(struct t3.0:. .\\) array_t3_ptr.data\\);" 1
Will do another full regtest ...