From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7395 invoked by alias); 2 Dec 2014 21:04:44 -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 7322 invoked by uid 48); 2 Dec 2014 21:04:40 -0000 From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/64043] [5 Regression] ICE (segfault) with LTO: in tree_check/tree.h:2758 get_binfo_at_offset/tree.c:11914 Date: Tue, 02 Dec 2014 21:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: 2014-12/txt/msg00264.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64043 Jan Hubicka changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at redhat dot com --- Comment #3 from Jan Hubicka --- OK, the problem is that the unit is compiled without -O2 and -fdevirtualize is not properly marked as Optimization (have separate patch for this). However it seems that for units that are not optimized with -fdevirtualize we can just drop OBJ_TYPE_REF and save some of IL memory? Jason, does this have chance to interfere with devirtualization required by C++ language that happens at -fno-devirtualize too? Honza Index: cp/class.c =================================================================== --- cp/class.c (revision 218249) +++ cp/class.c (working copy) @@ -736,7 +736,8 @@ build_vfn_ref (tree instance_ptr, tree i cp_build_addr_expr (aref, tf_warning_or_error)); /* Remember this as a method reference, for later devirtualization. */ - aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx); + if (flag_devirtualize) + aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx); return aref; } Index: testsuite/g++.dg/lto/pr64043_0.C =================================================================== --- testsuite/g++.dg/lto/pr64043_0.C (revision 0) +++ testsuite/g++.dg/lto/pr64043_0.C (revision 0) @@ -0,0 +1,14 @@ +// { dg-lto-do link } +// { dg-lto-options { { -flto -std=c++11 } } } +// { dg-extra-ld-options "-r -nostdlib -O2" } +class Validator +{ +public: + virtual ~Validator (); +}; +class FooWriter +{ + Validator *validator; + ~FooWriter (); +}; +FooWriter::~FooWriter () { delete validator; }