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/55932] [F03] ICE for structure constructor with scalar allocatable component Date: Sun, 05 Jan 2014 18:42:00 -0000 [thread overview] Message-ID: <bug-55932-4-KhdAa5hc3d@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-55932-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55932 --- Comment #5 from janus at gcc dot gnu.org --- The following is sufficient to get rid of the ICE: Index: gcc/fortran/trans-expr.c =================================================================== --- gcc/fortran/trans-expr.c (revision 206335) +++ gcc/fortran/trans-expr.c (working copy) @@ -6049,6 +6049,8 @@ gfc_trans_subcomponent_assign (tree dest, gfc_comp if (cm->ts.type == BT_CHARACTER) lse.string_length = cm->ts.u.cl->backend_decl; lse.expr = dest; + if (cm->attr.allocatable) + lse.expr = build_fold_indirect_ref_loc (input_location, lse.expr); tmp = gfc_trans_scalar_assign (&lse, &se, cm->ts, true, false, true); gfc_add_expr_to_block (&block, tmp); } With this patch, the test case in comment 3 compiles without error. However, it now segfaults at runtime, because alloc-on-assignment is still missing.
next prev parent reply other threads:[~2014-01-05 18:42 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-01-10 7:59 [Bug fortran/55932] New: DDT's default structure constructor does not work with having allocatable member variables stefan.mauerberger at gmail dot com 2013-01-10 10:38 ` [Bug fortran/55932] " dominiq at lps dot ens.fr 2013-01-11 11:50 ` stefan.mauerberger at gmail dot com 2014-01-05 17:40 ` [Bug fortran/55932] [F03] ICE for structure constructor with scalar allocatable component janus at gcc dot gnu.org 2014-01-05 17:51 ` janus at gcc dot gnu.org 2014-01-05 18:42 ` janus at gcc dot gnu.org [this message] 2014-01-09 20:39 ` janus at gcc dot gnu.org 2014-01-09 21:49 ` janus at gcc dot gnu.org 2014-01-10 14:10 ` janus at gcc dot gnu.org 2014-01-10 14:13 ` janus at gcc dot gnu.org 2015-04-17 12:34 ` dominiq at lps dot ens.fr
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-55932-4-KhdAa5hc3d@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: linkBe 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).