public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/55072] [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type
Date: Sat, 15 Dec 2012 13:46:00 -0000	[thread overview]
Message-ID: <bug-55072-4-C23HeM81Jz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <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 ...


  parent reply	other threads:[~2012-12-15 13:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  9:22 [Bug fortran/55072] New: [4.5/4.6/4.7/4.8 " burnus at gcc dot gnu.org
2012-10-25  9:30 ` [Bug fortran/55072] " burnus at gcc dot gnu.org
2012-11-07 10:35 ` [Bug fortran/55072] [4.6/4.7/4.8 " jakub at gcc dot gnu.org
2012-12-13 21:39 ` janus at gcc dot gnu.org
2012-12-13 22:20 ` dominiq at lps dot ens.fr
2012-12-13 23:04 ` janus at gcc dot gnu.org
2012-12-14 23:18 ` janus at gcc dot gnu.org
2012-12-14 23:19 ` janus at gcc dot gnu.org
2012-12-15  0:19 ` janus at gcc dot gnu.org
2012-12-15 10:56 ` janus at gcc dot gnu.org
2012-12-15 11:00 ` janus at gcc dot gnu.org
2012-12-15 13:06 ` janus at gcc dot gnu.org
2012-12-15 13:46 ` janus at gcc dot gnu.org [this message]
2012-12-15 16:05 ` janus at gcc dot gnu.org
2012-12-15 16:17 ` mikael at gcc dot gnu.org
2012-12-15 19:46 ` janus at gcc dot gnu.org
2012-12-15 20:47 ` janus at gcc dot gnu.org
2012-12-15 21:06 ` janus at gcc dot gnu.org
2012-12-15 21:26 ` janus at gcc dot gnu.org
2012-12-15 23:41 ` janus at gcc dot gnu.org
2013-01-09 13:17 ` pault at gcc dot gnu.org
2013-01-12 18:52 ` janus at gcc dot gnu.org
2013-01-13 12:06 ` janus at gcc dot gnu.org
2013-01-14 21:25 ` janus at gcc dot gnu.org
2013-01-14 21:45 ` janus at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55072-4-C23HeM81Jz@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).