From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22740 invoked by alias); 29 Oct 2015 12:34:18 -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 22704 invoked by uid 48); 29 Oct 2015 12:34:13 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51993] Erroneous type component initialization leads to internal compiler error Date: Thu, 29 Oct 2015 12:34: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: 4.7.0 X-Bugzilla-Keywords: accepts-invalid, diagnostic, ice-on-invalid-code X-Bugzilla-Severity: minor X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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-10/txt/msg02450.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51993 --- Comment #5 from Dominique d'Humieres --- > Changing the gcc_assert to an early return gives ... Confirmed with the patch --- ../_clean/gcc/fortran/decl.c 2015-10-27 18:14:22.000000000 +0100 +++ gcc/fortran/decl.c 2015-10-29 12:02:02.000000000 +0100 @@ -1293,7 +1293,9 @@ gfc_set_constant_character_len (int len, int slen; gcc_assert (expr->expr_type == EXPR_CONSTANT); - gcc_assert (expr->ts.type == BT_CHARACTER); + /* gcc_assert (expr->ts.type == BT_CHARACTER); */ + if (expr->ts.type != BT_CHARACTER) + return; slen = expr->value.character.length; if (len != slen) No regression.