From: Thomas Koenig <tkoenig@netcologne.de>
To: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [patch, fortran] Fix PR 66385, array constructors in FORALL
Date: Thu, 04 Jun 2015 09:57:00 -0000 [thread overview]
Message-ID: <55701E70.5090403@netcologne.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 779 bytes --]
Hello world,
front-end optimization and FORALL do not appear to mix well.
This patch fixes an ICE resulting from an attempt by front-end
optimization to use a BLOCK inside a FORALL statement.
I will commit this as obvious in a day or so unless somebody objects.
I will also backport (time to install the gcc 5 branch...)
There would be an alternative, in principle, to put the BLOCK around
the FORALL, but frankly, I don't think it is worth spending the
effort and complicating the code.
Regards
Thomas
2015-06-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66385
* frontend-passes.c (combine_array_constructor): Return early if
inside a FORALL loop.
2015-06-11 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/66385
* gfortran.dg/forall_17.f90: New test.
[-- Attachment #2: forall_17.f90 --]
[-- Type: text/x-fortran, Size: 336 bytes --]
! { dg-do compile }
! { dg-options "-ffrontend-optimize" }
! PR fortran/66385 - this used to ICE
! Original test case by Mianzhi Wang
program test
double precision::aa(30)
double precision::a(3,3),b
b=1d0
forall(i=1:3)
a(:,i)=b*[1d0,2d0,3d0]
end forall
forall(i=1:10)
aa(10*[0,1,2]+i)=1d0
end forall
end program
[-- Attachment #3: p1.diff --]
[-- Type: text/x-patch, Size: 451 bytes --]
Index: frontend-passes.c
===================================================================
--- frontend-passes.c (Revision 223876)
+++ frontend-passes.c (Arbeitskopie)
@@ -1243,6 +1243,10 @@ combine_array_constructor (gfc_expr *e)
if (in_assoc_list)
return false;
+ /* With FORALL, the BLOCKS created by create_var will cause an ICE. */
+ if (forall_level > 0)
+ return false;
+
op1 = e->value.op.op1;
op2 = e->value.op.op2;
reply other threads:[~2015-06-04 9:46 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=55701E70.5090403@netcologne.de \
--to=tkoenig@netcologne.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).