From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24282 invoked by alias); 29 Sep 2015 20:24:58 -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 24233 invoked by uid 55); 29 Sep 2015 20:24:53 -0000 From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67758] [GCC 6 regression] ICE on invalid use of COMMON Date: Tue, 29 Sep 2015 20:24: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: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: WAITING 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-09/txt/msg02327.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67758 --- Comment #3 from Steve Kargl --- On Tue, Sep 29, 2015 at 07:56:16PM +0000, kargl at gcc dot gnu.org wrote: > > troutmask:sgk[204] gfc6 -c r5.f > f951: internal compiler error: Segmentation fault > no stack trace because unwind library not available > Please submit a full bug report, > with preprocessed source if appropriate. > See for instructions. This fixes the regression. Index: symbol.c =================================================================== --- symbol.c (revision 228264) +++ symbol.c (working copy) @@ -3211,6 +3211,8 @@ gfc_restore_last_undo_checkpoint (void) while (csym != p) { + if (!csym) + goto syntax; cparent = csym; csym = csym->common_next; } @@ -3242,6 +3244,11 @@ gfc_restore_last_undo_checkpoint (void) if (!single_undo_checkpoint_p ()) pop_undo_change_set (latest_undo_chgset); + + return; + +syntax: + gfc_error ("syntax or semantics issue at %C"); } But, the real issue is that the second COMMON is not allowed to appear in the execution block of a program. gfortran should probably error out earlier.