From: "Daniel Franke" <franke.daniel@gmail.com>
To: fortran@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org, hjl@lucon.org
Subject: [patch, fortran] PR32867 - ICE on nested initialization expressions
Date: Tue, 24 Jul 2007 09:38:00 -0000 [thread overview]
Message-ID: <640ad44b0707240141p486b1fbco690a5631d812dc42@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 642 bytes --]
This is a regression that stems from my recent init-expressions patch.
Nested expressions were not simplified properly and thus led to ICEs
in various places. The cure is simple enough, H.J. already confirmed
that it also fixes the problem he observed.
:ADDPATCH fortran:
gcc/fortran:
2007-07-24 Daniel Franke <franke.daniel@gmail.com>
PR fortran/32867
* expr.c (check_init_expr): Simplify matched functions.
gcc/testsuite:
2007-07-24 Daniel Franke <franke.daniel@gmail.com>
PR fortran/32867
* fortran.dg/initialization_10.f90: New test.
Bootstrapped and regression tested on i686-pc-linux-gnu. Ok for trunk?
Regards
Daniel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pr32867.patch --]
[-- Type: text/x-diff; name="pr32867.patch", Size: 1355 bytes --]
Index: fortran/expr.c
===================================================================
--- fortran/expr.c (revision 126826)
+++ fortran/expr.c (working copy)
@@ -2121,7 +2132,7 @@
}
if (m == MATCH_YES)
- t = SUCCESS;
+ t = gfc_simplify_expr (e, 0);
break;
Index: testsuite/gfortran.dg/initialization_10.f90
===================================================================
--- testsuite/gfortran.dg/initialization_10.f90 (revision 0)
+++ testsuite/gfortran.dg/initialization_10.f90 (revision 0)
@@ -0,0 +1,32 @@
+! { dg-do compile }
+!
+! PR fortran/32867 - nested initialization expression not simplified
+!
+! Testcase contributed by H. J. Lu <hjl AT lucon DOT org>
+!
+
+MODULE Readdata_mod
+IMPLICIT NONE
+Private
+Public Parser
+ integer, parameter :: nkeywords = 2
+character(80), PARAMETER, dimension(1:nkeywords) :: keywords = &
+(/'PROBLEMSIZE ', &
+ 'NFTRANS_TD '/)
+
+CONTAINS
+SUBROUTINE Parser(nx, ny, keyword)
+integer, intent(inout) :: nx, ny
+character(80), intent(inout) :: keyword
+
+select case (keyword)
+ case (trim(keywords(1))) ! PROBLEMSIZE
+ nx = 1
+ case (trim(keywords(2))) !'NFTRANS_TD'
+ ny = 1
+end select
+
+END SUBROUTINE Parser
+END MODULE Readdata_mod
+
+! { dg-final { cleanup-modules "Readdata_mod" } }
next reply other threads:[~2007-07-24 8:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 9:38 Daniel Franke [this message]
2007-07-24 17:01 ` Daniel Franke
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=640ad44b0707240141p486b1fbco690a5631d812dc42@mail.gmail.com \
--to=franke.daniel@gmail.com \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=hjl@lucon.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).