From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20848 invoked by alias); 11 Sep 2012 13:46:26 -0000 Received: (qmail 20827 invoked by uid 22791); 11 Sep 2012 13:46:23 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED 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; Tue, 11 Sep 2012 13:46:10 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/50640] [4.7 Regression] [OOP] FAIL: gfortran.dg/select_type_12.f03 -O (internal compiler error) Date: Tue, 11 Sep 2012 13:46: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-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 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 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: 2012-09/txt/msg00862.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50640 --- Comment #26 from Tobias Burnus 2012-09-11 13:44:44 UTC --- The solution of comment 3, fixed by comment 24 seems to break the test case of PR fortran/53718. Reverting the patch (comment 24, except for unrelated class.c part) fixes the issue of PR 53718. For some reason, reverting the patch no longer triggers the issue of this PR, i.e. gfortran.dg/select_type_12.f03 gives no ICE. Hence, it seems as if comment 2 no longer applies. To recap (rough version): gfortran generates in MAIN__ the nested function __copy_MAIN___T1 and assigns it (function pointer) to a field of the static struct __vtab_MAIN___T1. But __copy_MAIN___T1 does not get called in MAIN__ but only in "foo" which is also a nested function of MAIN__ - thus, __vtab_MAIN___T1 didn't get marked as referenced, causing the ICE. The patch in comment 24 hoisted the "__copy_MAIN___T1" out of MAIN__ into the TU space. Does anyone see a reason why the patch shouldn't be revered? (I assume one of Richard's patches in May fixed the issue. That probably means that one has to find another solution for 4.7. Suggestions?) Comments - especially from the middle-end side?