public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Damian Rouson <rouson@lbl.gov>
To: fortran@gcc.gnu.org
Subject: PRs 100650 and 49324: intrinsic assignment of reshaped derived type array constructor
Date: Wed, 21 Jun 2023 06:30:59 +0200	[thread overview]
Message-ID: <CAM2rSoWbja69W2o=nqptp5vgXL19mjPdoB58RxVQy1Omy59-ow@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 693 bytes --]

I just added a shorter reproducer (below) to PR 100650.  Is this also
related to PR 49324?

Damian

% cat reshape-array-constructor.f90
  implicit none
  type foo_t
    integer, allocatable :: bar(:)
  end type

  type(foo_t) foo(2,1)
  integer :: i, j,  n(2,2,1) = reshape([-1,-1,1,1], [2,2,1])

  foo = reshape([([(foo_t(merge(0, 1, n(:,i,j) > 0)), i=1,2)], j=1,1)],
[2,1])
  print *, merge(0, 1, n(:,1,1) > 0), foo(1,1)%bar
  print *, merge(0, 1, n(:,2,1) > 0), foo(2,1)%bar
end
% gfortran reshape-array-constructor.f90
% ./a.out
           1           1   786120848       65240
           0           0   786120848       65240
% gfortran --version
GNU Fortran (Homebrew GCC 13.1.0) 13.1.0

                 reply	other threads:[~2023-06-21  4:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAM2rSoWbja69W2o=nqptp5vgXL19mjPdoB58RxVQy1Omy59-ow@mail.gmail.com' \
    --to=rouson@lbl.gov \
    --cc=fortran@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).