public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/44529] [F03] array allocation with SOURCE
Date: Sun, 13 Jun 2010 21:38:00 -0000 [thread overview]
Message-ID: <20100613213835.32746.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44529-16146@http.gcc.gnu.org/bugzilla/>
------- Comment #1 from janus at gcc dot gnu dot org 2010-06-13 21:38 -------
(In reply to comment #0)
> First example:
>
>
> integer, allocatable :: a(:), b(:)
> allocate (a, source = b)
> end
>
>
> This is rejected with
>
> allocate (a, source = b)
> 1
> Error: Array specification required in ALLOCATE statement at (1)
>
> although it is valid (cf. F08:C633).
The error message is fixed with this patch:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 160678)
+++ gcc/fortran/resolve.c (working copy)
@@ -6449,10 +6449,10 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code
if (pointer || (dimension == 0 && codimension == 0))
goto success;
- /* Make sure the next-to-last reference node is an array specification. */
-
- if (ref2 == NULL || ref2->type != REF_ARRAY || ref2->u.ar.type == AR_FULL
- || (dimension && ref2->u.ar.dimen == 0))
+ /* F08:C633. */
+ if (!code->expr3
+ && (ref2 == NULL || ref2->type != REF_ARRAY || ref2->u.ar.type ==
AR_FULL
+ || (dimension && ref2->u.ar.dimen == 0)))
{
gfc_error ("Array specification required in ALLOCATE statement "
"at %L", &e->where);
But then this test case also ICEs:
c0a.f90:2:0: internal compiler error: in gfc_array_allocate, at
fortran/trans-array.c:4056
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44529
next prev parent reply other threads:[~2010-06-13 21:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-13 20:52 [Bug fortran/44529] New: " janus at gcc dot gnu dot org
2010-06-13 21:38 ` janus at gcc dot gnu dot org [this message]
2010-06-15 9:40 ` [Bug fortran/44529] " burnus at gcc dot gnu dot org
2010-08-29 18:06 ` burnus at gcc dot gnu dot org
[not found] <bug-44529-4@http.gcc.gnu.org/bugzilla/>
2011-02-06 12:19 ` tkoenig at gcc dot gnu.org
2012-02-17 9:42 ` burnus at gcc dot gnu.org
2013-07-25 12:17 ` burnus 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=20100613213835.32746.qmail@sourceware.org \
--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).