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 19:12:22 +0000	[thread overview]
Message-ID: <bug-107968-4-DC3xndnqL6@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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-12-05
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

A look at the tree dump shows a funny expansion of the array section in
the data transfer (write statement).  It appears that some optimization
of the transfer of arrays is attempted, but the stride looks wrong.

Replacing

  WRITE (0,*) vertices_pointer%vlon(1:)

by any of the following produces different - working - output:

  WRITE (0,*) [vertices_pointer%vlon(1:)]
  WRITE (0,*) (vertices_pointer%vlon(1:))
  WRITE (0,*) (vertices_pointer%vlon(i),i=1,size(vertices_pointer%vlon))

And - as reported - why should the addition of a (dead) pointer assignment
after the write change the way the array section is expanded?

Looking at older gfortran version, all tested seem to fail.
And with the dead pointer assignment uncommented, gfortran-7 ICEs.

  reply	other threads:[~2022-12-05 19:12 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 ` anlauf at gcc dot gnu.org [this message]
2022-12-05 21:36 ` [Bug fortran/107968] " anlauf 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-107968-4-DC3xndnqL6@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).