From patchwork Fri Mar 27 10:30:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 455376 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48A661400D5 for ; Fri, 27 Mar 2015 21:30:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=JK7LTnem; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=ys0D+HT6Ee8Qf2Wp5ODrChNB8Mfhypq/h9juQmLjq0oWGInMtJi9H T89VsjBjHwXNHVuo8e96PvvjMIiL1HS++eP/PlIAX/iQzdW4N19Qy1naK/jBRY8X cmSKroCANdBgMDS5xKN5wO/F2A4nmv3PWUxd8BjpLuCUSpMJ2QVy00= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=GJlI7fWBGHcADBwyKJ3a8ZraQic=; b=JK7LTnemx4CGFmzSxOyZ tFvwMrZEKw+SRNtygJ/oJp+FwdDajpMQEoY82YHc99fIERFIKSmoumZ33sAfPgWX eMU7iRrHRhRQHeGleZptZXD6zY9jYXo+L3FHpXCr2yNUH0/gJRvOYzgBSIXmaDob /m8xUESUlDFH13P/QKzVtJQ= Received: (qmail 105899 invoked by alias); 27 Mar 2015 10:30:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 105886 invoked by uid 89); 27 Mar 2015 10:30:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 27 Mar 2015 10:30:35 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 9D0FE546B1C; Fri, 27 Mar 2015 11:30:31 +0100 (CET) Date: Fri, 27 Mar 2015 11:30:31 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix ICE in is_a invocation from cgraph_update_edges_for_call_stmt_node Message-ID: <20150327103031.GA44779@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi, this patch fixes ICE in is_a test when cgraph_update_edges_for_call_stmt_node tries to convert non-call stmt to call. I have bootstrapped/regtested x86_64-linux and tested firefox/chromium LTO build, so hope it is the last issue surfacing from the today verifier change. PR middle-end/65595 * cgraph.c (cgraph_update_edges_for_call_stmt_node): Only do redirection if the call is not optimized out. * gcc.c-torture/compile/pr65595.c: New testcase. Index: cgraph.c =================================================================== --- cgraph.c (revision 221707) +++ cgraph.c (working copy) @@ -1516,7 +1516,7 @@ cgraph_update_edges_for_call_stmt_node ( if (e) { /* Keep calls marked as dead dead. */ - if (e->callee + if (new_call && e->callee && DECL_BUILT_IN_CLASS (e->callee->decl) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (e->callee->decl) == BUILT_IN_UNREACHABLE) { Index: testsuite/gcc.c-torture/compile/pr65595.c =================================================================== --- testsuite/gcc.c-torture/compile/pr65595.c (revision 0) +++ testsuite/gcc.c-torture/compile/pr65595.c (revision 0) @@ -0,0 +1,19 @@ +extern void *memcpy(void *, const void *, unsigned long); +struct in6_addr { + struct { + int u6_addr32[4]; + }; +}; +struct foo { + struct in6_addr daddr; + struct in6_addr saddr; +} a; +extern void ip6_route_output(struct foo, int); +int b; +static void find_route_ipv6(struct in6_addr *p1) { + if (p1) + memcpy(0, p1, sizeof(struct in6_addr)); + ip6_route_output(a, b); +} +void cxgbi_ep_connect() { find_route_ipv6(0); } +