From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104599 invoked by alias); 2 Jul 2015 21:40:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 104563 invoked by uid 48); 2 Jul 2015 21:40:29 -0000 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/66725] Issue with silent conversion int to char, ICE if int too large Date: Thu, 02 Jul 2015 21:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 5.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: kargl at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: priority bug_status cf_reconfirmed_on cc assigned_to everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg00202.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66725 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P4 Status|UNCONFIRMED |NEW Last reconfirmed| |2015-07-02 CC| |kargl at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |kargl at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #3 from kargl at gcc dot gnu.org --- It seems that a type check is missing for STATUS=some_entity. With this diff (watch cut-n-paste tab corruption), Index: io.c =================================================================== --- io.c (revision 225348) +++ io.c (working copy) @@ -2071,6 +2071,12 @@ gfc_match_open (void) static const char *status[] = { "OLD", "NEW", "SCRATCH", "REPLACE", "UNKNOWN", NULL }; + if (open->status->ts.type != BT_CHARACTER) + { + gfc_error("scalar-default-char-expr required at %C"); + goto cleanup; + } + if (!compare_to_allowed_values ("STATUS", status, NULL, NULL, open->status->value.character.string, "OPEN", warn)) I get % gfc6 -o z aa.f90 aa.f90:2:23: open (1, status=257) 1 Error: scalar-default-char-expr required at (1) I suspect the other TAGS need a similar check.