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/64209] [OOP] runtime segfault with CLASS(*), INTENT(OUT) dummy argument
Date: Thu, 18 Dec 2014 22:07:00 -0000	[thread overview]
Message-ID: <bug-64209-4-a36Grl1w8a@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-64209-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64209

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |janus at gcc dot gnu.org

--- Comment #4 from janus at gcc dot gnu.org ---
The following patch is sufficient to make the reduced test case in comment 2
work:


Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c    (Revision 218874)
+++ gcc/fortran/trans-expr.c    (Arbeitskopie)
@@ -980,6 +980,9 @@ gfc_trans_class_init_assign (gfc_code *code)
       src.expr = gfc_build_addr_expr (NULL_TREE, src.expr);

       tmp = gfc_build_memcpy_call (dst.expr, src.expr, memsz.expr);
+
+      tmp = build3_loc (input_location, COND_EXPR, TREE_TYPE (tmp),
+            src.expr, tmp, build_empty_stmt (input_location));
     }

   if (code->expr1->symtree->n.sym->attr.optional


However, the original test case in comment 0 still segfaults, so there seems to
be yet another problem.


  parent reply	other threads:[~2014-12-18 22:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-06 16:00 [Bug fortran/64209] New: [OOP] copy class(*) component from type with a subroutine polajnar.miha at gmail dot com
2014-12-09 19:27 ` [Bug fortran/64209] " dominiq at lps dot ens.fr
2014-12-18 19:20 ` [Bug fortran/64209] [OOP] runtime segfault with CLASS(*), INTENT(OUT) dummy argument janus at gcc dot gnu.org
2014-12-18 20:58 ` janus at gcc dot gnu.org
2014-12-18 22:07 ` janus at gcc dot gnu.org [this message]
2014-12-18 22:53 ` janus at gcc dot gnu.org
2014-12-18 23:24 ` janus at gcc dot gnu.org
2014-12-19 19:29 ` janus at gcc dot gnu.org
2014-12-19 19:32 ` 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-64209-4-a36Grl1w8a@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).