From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13798 invoked by alias); 4 Feb 2014 13:19:53 -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 13765 invoked by uid 48); 4 Feb 2014 13:19:48 -0000 From: "trippels at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/60058] [4.9 Regression] internal compiler error: Segmentation fault Date: Tue, 04 Feb 2014 13:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: trippels at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: 2014-02/txt/msg00299.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60058 --- Comment #1 from Markus Trippelsdorf --- Looks like an "if (target)" wrapper like in the other hunk of r207447 is necessary. diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 68afeb0d89e4..dab9e8a0f80d 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1573,20 +1573,23 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, { target = gimple_get_virt_method_for_vtable (ie->indirect_info->otr_token, vtable, offset); - if ((TREE_CODE (TREE_TYPE (target)) == FUNCTION_TYPE - && DECL_FUNCTION_CODE (target) == BUILT_IN_UNREACHABLE) - || !possible_polymorphic_call_target_p - (ie, cgraph_get_node (target))) + if (target) { - if (dump_file) - fprintf (dump_file, - "Type inconsident devirtualization: %s/%i->%s\n", - ie->caller->name (), ie->caller->order, - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target))); - target = builtin_decl_implicit (BUILT_IN_UNREACHABLE); - cgraph_get_create_node (target); + if ((TREE_CODE (TREE_TYPE (target)) == FUNCTION_TYPE + && DECL_FUNCTION_CODE (target) == BUILT_IN_UNREACHABLE) + || !possible_polymorphic_call_target_p + (ie, cgraph_get_node (target))) + { + if (dump_file) + fprintf (dump_file, + "Type inconsident devirtualization: %s/%i->%s\n", + ie->caller->name (), ie->caller->order, + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target))); + target = builtin_decl_implicit (BUILT_IN_UNREACHABLE); + cgraph_get_create_node (target); + } + return target; } - return target; } }