From: Tobias Burnus <tobias@codesourcery.com>
To: Harald Anlauf <anlauf@gmx.de>
Cc: fortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR fortran/99205 - [10/11 Regression] Out of memory with undefined character length
Date: Wed, 10 Mar 2021 21:18:02 +0100 [thread overview]
Message-ID: <f3a6e28a-ebf3-62ac-5a6a-dd6604f57e61@codesourcery.com> (raw)
In-Reply-To: <trinity-982a86be-17e0-42a2-ad3c-b00a5cf85014-1615405404985@3c-app-gmx-bs58>
Dear Harald,
On 10.03.21 20:43, Harald Anlauf wrote:
>> In the following variant of the program, the invalid
>> variable declaration of 'c' itself is avoided by using
>> a block:
>>
>> integer :: ll
>> ll = 4
>> block
>> character(ll) :: c(2), cc(2)
>> character(ll) :: c2(2), cc2(2)
>> data c /'a', 'b'/
>> data c2(:)(1:1) /'a', 'b'/
>> common /block/ cc, cc2
>> end block
>> end
> No, this example is invalid
Of course this example is invalid – I only wrote that it avoids the
issues with the declaration of 'C' itself not that the code as a whole
is valid.
Regarding:
> C1107(R1107) A block-specification-part shall not contain a COMMON, EQUIVALENCE, INTENT, NAMELIST,
> OPTIONAL, statement function, or VALUE statement.
That could be mended by removing the 'common' line. Especially as I
forgot to actually use 'cc'/'cc2' in a data statement ... Or by using a
host-associated 'll' instead of a block. But that still will have the
automatic issue for common, hence, removing common is probably best. One
the other hand:
In any case, there are hundreds of ways to write invalid code – chose
one you like for the testcase :-)
Thanks for this patch – and all the belated patch work!
Tobias
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf
next prev parent reply other threads:[~2021-03-10 20:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 19:45 Harald Anlauf
2021-03-10 10:06 ` Tobias Burnus
2021-03-10 19:43 ` Harald Anlauf
2021-03-10 20:18 ` Tobias Burnus [this message]
2021-03-10 21:26 ` Harald Anlauf
2021-03-10 21:52 ` Tobias Burnus
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=f3a6e28a-ebf3-62ac-5a6a-dd6604f57e61@codesourcery.com \
--to=tobias@codesourcery.com \
--cc=anlauf@gmx.de \
--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).