From: Harald Anlauf <anlauf@gmx.de>
To: Paul Richard Thomas <paul.richard.thomas@gmail.com>,
"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, fortran] PR109451 - ICE in gfc_conv_expr_descriptor with ASSOCIATE and substrings
Date: Wed, 12 Apr 2023 21:26:36 +0200 [thread overview]
Message-ID: <2ef9c2f2-2b56-2dd1-15cb-ff3318ea1315@gmx.de> (raw)
In-Reply-To: <CAGkQGiJJYwM1w_ECV-GgpoauKa8LT+08u3c4XAEpBGosZSxnkA@mail.gmail.com>
Hi Paul,
On 4/12/23 17:25, Paul Richard Thomas via Gcc-patches wrote:
> Hi All,
>
> I think that the changelog says it all. OK for mainline?
this looks almost fine, but still fails if one directly uses the
dummy argument as the ASSOCIATE target, as in:
program p
implicit none
character(4) :: c(2) = ["abcd","efgh"]
call dcs0 (c)
! call dcs0 (["abcd","efgh"])
contains
subroutine dcs0(a)
character(len=*), intent(in) :: a(:)
print *, size(a),len(a)
associate (q => a(:))
print *, size(q),len(q)
end associate
associate (q => a(:)(:))
print *, size(q),len(q)
end associate
return
end subroutine dcs0
end
This prints e.g.
2 4
2 0
2 0
(sometimes I also get junk values for the character length).
Can you please have another look?
Thanks,
Harald
> Paul
>
> Fortran: Fix some deferred character problems in associate [PR109451]
>
> 2023-04-07 Paul Thomas <pault@gcc.gnu.org>
>
> gcc/fortran
> PR fortran/109451
> * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
> character length backend decl before using it. Suppress the
> assignment if lhs equals rhs.
> * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
> associate variables pointing to a variable. Add comment.
>
>
> gcc/testsuite/
> PR fortran/109451
> * gfortran.dg/associate_61.f90 : New test
next prev parent reply other threads:[~2023-04-12 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 15:25 Paul Richard Thomas
2023-04-12 19:26 ` Harald Anlauf [this message]
2023-04-13 6:18 ` Paul Richard Thomas
2023-04-14 8:18 ` Paul Richard Thomas
2023-04-14 16:50 ` Harald Anlauf
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=2ef9c2f2-2b56-2dd1-15cb-ff3318ea1315@gmx.de \
--to=anlauf@gmx.de \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=paul.richard.thomas@gmail.com \
/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).