public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107968] array slicing gives wrong result for an array pointer defined in a subroutine Date: Mon, 05 Dec 2022 21:36:21 +0000 [thread overview] Message-ID: <bug-107968-4-6I4IEbhdvD@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107968-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107968 --- Comment #2 from anlauf at gcc dot gnu.org --- The following attempt fixes the erroneous output: diff --git a/gcc/fortran/trans-io.cc b/gcc/fortran/trans-io.cc index 9f86815388c..c4525f67ef3 100644 --- a/gcc/fortran/trans-io.cc +++ b/gcc/fortran/trans-io.cc @@ -2641,6 +2641,9 @@ gfc_trans_transfer (gfc_code * code) seen_vector = true; break; } + + if (!seen_vector && !gfc_is_not_contiguous (expr)) + goto scalarize; } if (seen_vector && last_dt == READ) However, this defeats the optimization on array I/O and regresses on gfortran.dg/implied_do_io_1.f90 gfortran.dg/implied_do_io_4.f90
prev parent reply other threads:[~2022-12-05 21:36 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-12-05 7:16 [Bug fortran/107968] New: " dreier at dkrz dot de 2022-12-05 19:12 ` [Bug fortran/107968] " anlauf at gcc dot gnu.org 2022-12-05 21:36 ` anlauf at gcc dot gnu.org [this message]
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-107968-4-6I4IEbhdvD@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).