public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mikael dot morin at tele2 dot fr" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/37749] ICE on array section with vector subscript Date: Wed, 29 Oct 2008 21:00:00 -0000 [thread overview] Message-ID: <20081029205953.31612.qmail@sourceware.org> (raw) In-Reply-To: <bug-37749-87@http.gcc.gnu.org/bugzilla/> ------- Comment #1 from mikael dot morin at tele2 dot fr 2008-10-29 20:59 ------- Reduced case: subroutine subr (m, n, a, b, c, d, p) implicit none integer m, n real a(m,n), b(m,n), c(n,n), d(m,n) integer p(n) d = a(:,p) - matmul(b, c) end subroutine The problem is with a(:,p) - matmul(b,c) It arises because: (1) gfc_conv_loop_setup chooses matmul's ss to setup the loop bounds. This explains why -matmul(b,c) + a(:,p) works. (2) The loop->to are asserted to be NULL in gfc_conv_loop_setup (GFC_SS_FUNCTION case) (3) gfc_add_ss_loop_code for the second dimension of a(:,p) calls gfc_set_loop_bounds_from_array_spec which sets the second dimension of the loop.to (4) in the loop setting the descriptor in gfc_trans_create_temp_array, in the first iteration, (n = 0), loop.to is NULL, and the size is set to NULL. (5) In the next iteration, (n = 1), loop.to != NULL, and the loop follows the normal path. The size however was set to NULL (condition (4)). (4) and (5) explain why it works with a(q,:) - matmul(b,c) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37749
next prev parent reply other threads:[~2008-10-29 21:00 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-10-06 14:04 [Bug fortran/37749] New: " jakub at gcc dot gnu dot org 2008-10-06 19:48 ` [Bug fortran/37749] " burnus at gcc dot gnu dot org 2008-10-29 21:00 ` mikael dot morin at tele2 dot fr [this message] 2008-10-29 21:06 ` mikael dot morin at tele2 dot fr 2008-10-30 11:13 ` pault at gcc dot gnu dot org 2008-10-30 20:50 ` pault at gcc dot gnu dot org 2008-11-01 19:48 ` pault at gcc dot gnu dot org 2008-11-01 19:49 ` pault at gcc dot gnu dot 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=20081029205953.31612.qmail@sourceware.org \ --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).