From: Tobias Burnus <tobias@codesourcery.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>, fortran <fortran@gcc.gnu.org>
Subject: PING - (Re: [Patch] Fortran: Various CLASS + assumed-rank fixed [PR102541])
Date: Wed, 6 Oct 2021 12:24:16 +0200 [thread overview]
Message-ID: <a9208ecd-e419-1a28-3319-bf79f72dd8b3@codesourcery.com> (raw)
In-Reply-To: <b62166a0-3b2b-8f79-0d55-dae6f912b167@codesourcery.com>
Early ping for this patch.
(I still plan to review Harald's pending patch soon, unless someone
beats me:
https://gcc.gnu.org/pipermail/gcc-patches/2021-October/580810.html )
On 01.10.21 02:43, Tobias Burnus wrote:
> Hi all,
>
> this patch fixes a bunch of issues with CLASS.
>
> * * *
>
> Side remark: I disliked the way CLASS is represented when it was
> introduced;
> when writing the testcase for this PR and kept fixing the testcase
> fallout,
> I started to hate it!
> I am sure that there are more issues – but I tried hard not too look
> closer
> at surrounding code to avoid hitting more issues.
> (If you look for a project, I think if you put attributes on separate
> lines,
> like a separate "POINTER :: var" line, you have a high chance to hit the
> error.)
>
> * * *
>
> What I found rather puzzling is that the 'optional' argument could be
> either
> on sym->attr.optional or on CLASS_DATA (sym)->attr.optional. I think one
> occurs for 'foo2' and the other for 'foo4' - not that I understand why it
> differs.
>
> I think it is otherwise straight forward. Regarding the original issue:
>
> In order to detect an assumed-size argument to an assumed-rank array,
> the last dimension has 'ubound = -1' to indicate an assume-size array;
> for those size(x, dim=rank(x)-1) == -1 and size(x) < 0
>
> However, when the dummy argument (and hence: actual argument) is either
> a pointer or an allocatable, the bound is passed as is (in particular,
> "-1" is a valid ubound and size(x) >= 0). – However, if the actual
> argument is unallocated/not associated, rank(var) still is supposed to
> work - hence, it has to be set.
>
> The last two items did work before - but not for CLASS -> CLASS.
> Additionally,
> the ubound = -1 had an issue for CLASS -> TYPE as the code assumed that
> expr->ref is the whole array ("var(full-array-ref)") but for CLASS the
> expr->ref is a component and only expr->ref->next is the array ref.
> ("var%_data(full-array-ref)").
>
> OK for mainline?
>
> Tobias
>
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
next prev parent reply other threads:[~2021-10-06 10:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 0:43 [Patch] Fortran: Various CLASS + assumed-rank fixed [PR102541] Tobias Burnus
2021-10-06 10:24 ` Tobias Burnus [this message]
2021-10-11 20:13 ` PING**2 - (Re: [Patch] Fortran: Various CLASS + assumed-rank fixed [PR102541]) Tobias Burnus
2021-10-10 19:27 ` [Patch] Fortran: Various CLASS + assumed-rank fixed [PR102541] Harald Anlauf
2021-10-11 11:32 ` Tobias Burnus
2021-10-11 20:20 ` 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=a9208ecd-e419-1a28-3319-bf79f72dd8b3@codesourcery.com \
--to=tobias@codesourcery.com \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@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).