From patchwork Fri Sep 13 09:37:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 274696 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 38B5B2C0154 for ; Fri, 13 Sep 2013 19:37:18 +1000 (EST) 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=JuNF2w+f7z6mr7B7lLEzw1uONxV93TQ5QgpTfSrPhLaK8Dusad5mT zjOWbTdk8UILc8zWP257lcuIuerQcp6VbA6/BNFn7ewIZ1rPjgbmAcszjk83Gi4L Ic+x9kjypmUBd0APyT7oBvAxh27R3MAy8gKS/EaxMWMZIDcqAdwH2g= 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=zOK0eNR+LThKywBZlQM8PJ8ZeCg=; b=ePgq/hE0Clsg/GHCvBB2 a2Pby2mrZRO9unF7hMgM6RRHV92IcXoXpVRWSN08T7T7JUCX50781plTwHSIBq43 isGZ3GPXFneHy13zXmhHq9CNuHRpYf6VnJ6YZoEGgIT9n6c1tFCnaz6cA3OBqkQX +qXHR4W7Uin3ADnTO9XFLXY= Received: (qmail 12584 invoked by alias); 13 Sep 2013 09:37:12 -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 12575 invoked by uid 89); 13 Sep 2013 09:37:12 -0000 Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Sep 2013 09:37:12 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL, BAYES_00, RDNS_NONE autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B87E8A52BF for ; Fri, 13 Sep 2013 11:37:09 +0200 (CEST) Date: Fri, 13 Sep 2013 11:37:09 +0200 From: Martin Jambor To: GCC Patches Subject: [PATCH, PR 58388] Weaken an assert in try_make_edge_direct_simple_call Message-ID: <20130913093709.GI6732@virgil.suse> Mail-Followup-To: GCC Patches MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Hi, the assert in try_make_edge_direct_simple_call does not really do the right thing when we have actually removed a speculation rather than just a previously indirect edge direct because the cs->callee might have been inlined or cloned and thus be different from the constant in the jump function. So I added a condition that triggers when the edge made direct was speculative to make the assert happy in these situations. I have bootstrapped and tested the patch on x86_64-linux without any issues. I have also checked that the error goes away when I do profiled LTO bootstrap but the process then halted on Werror caliming that anchor in get_section_anchor in varasm.c can be used uninitialized. When I "fixed" that by initializing it to NULL, the bootstrap failed on something else, I've only started to look why. Nevertheless, the patch fixes the problem with my code in ipa.cp. It has been pre-approved by Honza in bugzilla, I will commit it later today. Thanks, Martin 2013-09-12 Martin Jambor PR bootstrap/58388 * ipa-prop.c (try_make_edge_direct_simple_call): Be less strict in the assert if the edge was a speculative one. Index: src/gcc/ipa-prop.c =================================================================== --- src.orig/gcc/ipa-prop.c +++ src/gcc/ipa-prop.c @@ -2603,7 +2603,8 @@ try_make_edge_direct_simple_call (struct { bool ok; gcc_checking_assert (cs->callee - && (jfunc->type != IPA_JF_CONST + && (cs != ie + || jfunc->type != IPA_JF_CONST || !cgraph_node_for_jfunc (jfunc) || cs->callee == cgraph_node_for_jfunc (jfunc))); ok = try_decrement_rdesc_refcount (jfunc);