From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30882 invoked by alias); 11 Dec 2013 14:23:29 -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 30860 invoked by uid 48); 11 Dec 2013 14:23:26 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/59468] [4.9 Regression] ICE on invalid C++ code with LTO in gimple_get_virt_method_for_binfo, at gimple-fold.c:3224 Date: Wed, 11 Dec 2013 14:23: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: 4.9.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords 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: 2013-12/txt/msg00972.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59468 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-invalid-code CC| |hubicka at gcc dot gnu.org --- Comment #2 from Richard Biener --- We have (int (*__vtbl_ptr_type) ()) &_ZTI1S at this point: 3219 fn = fold_ctor_reference (TREE_TYPE (TREE_TYPE (v)), init, 3220 offset, size, v); 3221 if (!fn || integer_zerop (fn)) 3222 return NULL_TREE; 3223 gcc_assert (TREE_CODE (fn) == ADDR_EXPR 3224 || TREE_CODE (fn) == FDESC_EXPR); (gdb) p v $2 = The vtable layout does not match (so we have a ODR violation here). It would be helpful to not ICE and maybe diagnose this. Not ICEing is simple by giving up instead of asserting in gimple_get_virt_method_for_binfo. We shouldn't merge any of the non-matching vtables though and thus not the types either. So I'm not yet sure how the "wrong" type can end up here.