From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18329 invoked by alias); 3 Jun 2011 18:11:31 -0000 Received: (qmail 18320 invoked by uid 22791); 3 Jun 2011 18:11:30 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_SG X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Jun 2011 18:11:17 +0000 From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49278] internal compiler error: Segmentation fault X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 03 Jun 2011 18:11:00 -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 X-SW-Source: 2011-06/txt/msg00208.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49278 --- Comment #2 from Steve Kargl 2011-06-03 18:10:40 UTC --- On Fri, Jun 03, 2011 at 04:08:05PM +0000, kargl at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49278 > > Reduced testcase. > > module oad_active > implicit none > type active > sequence > real :: v > real :: d =0. > end type > end module > > module tots_c > use oad_active > implicit none > type(active), save :: trlkold > data trlkold%v /0./ > end module > This simply patch fixes the segfault with the compiler. Index: trans-expr.c =================================================================== --- trans-expr.c (revision 174566) +++ trans-expr.c (working copy) @@ -4638,7 +4638,7 @@ gfc_conv_structure (gfc_se * se, gfc_exp cm = expr->ts.u.derived->components; for (c = gfc_constructor_first (expr->value.constructor); - c; c = gfc_constructor_next (c), cm = cm->next) + c && cm; c = gfc_constructor_next (c), cm = cm->next) { /* Skip absent members in default initializers and allocatable components. Although the latter have a default initializer It's not clear if it achieves the desired result. The following aborts. Note sure if it is conforming. module oad_active implicit none type active integer :: v integer :: d = 42 end type end module module tots_c use oad_active implicit none type(active), save :: trlkold data trlkold%v /100/ end module program foo use tots_c implicit none if (trlkold%d /= 42) call abort if (trlkold%v /= 100) call abort end program foo