From patchwork Thu Dec 19 19:33:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teresa Johnson X-Patchwork-Id: 303687 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 8DC1C2C0094 for ; Fri, 20 Dec 2013 06:33:13 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=gqAJjSnHeQZB1F1T2nzjKFoeVfWixCnpspSg6qi7iVrKoP 2dR0AASeg7B3v1UHDZxOr8zvTQlpjkn/oL9PUmwZXP7yqTq+huS0pBwd/9D2EcMN FUT5guwLqZub4KuWVd4rdxRx/6uVB50tg0c69OMDhQMdz7XS/oUl1/ldm46UM= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=uouy+euYNic+3dNvaC2jLqOkqNQ=; b=wB4/zRs4wkV9bChTubd3 FBD1TJhbndrjS+cVawRqPETIAIp620anFE7oAz94xdaeRq5TPVfihoEvYgE6m1Vy JJHualLu+xMYixdklf3/l9NGv0jNOyAIORnvRJyGQCqdEd3OnBcw1xw+IRRXi7aW fxbFECuStexoUCPKftKwkNs= Received: (qmail 30551 invoked by alias); 19 Dec 2013 19:33:05 -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 30542 invoked by uid 89); 19 Dec 2013 19:33:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f179.google.com Received: from mail-qc0-f179.google.com (HELO mail-qc0-f179.google.com) (209.85.216.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 19 Dec 2013 19:33:04 +0000 Received: by mail-qc0-f179.google.com with SMTP id i8so1380157qcq.10 for ; Thu, 19 Dec 2013 11:33:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=KrKP/YSoP6liGj4gJjEdCYGB0WS5rRn+c6661QuJSFg=; b=Pe43oWXLrZMGs7h5aRW7+cUzQBxoZEIkLfaBsi9h/Ga94KkHrRCBLfzP8jfcQknQiA maW8bbsApmL1wAnBQFF123FDvgPQJOlX4eBpl+76hdBntz68Bsi0EPR7MSEhiiSm6lWc D97859YgdA+6M8xj0gKJicfqUh4xmSmrhfildCaL0TbH5L73SiXxxWV1YZ1awGnEOAXm JckUMtWt3T8gJX1W1Jk6gRYItSPq/8JLjcNXDou8im92lTewm8gFEf/nDhFaTk04OEUw 7LpnwsRImfLsjeHcfgVeTLKERGAB65ZTPw5kONVjPSVSWQ10ZuudbqUb3PIPPiDqZLL/ hXmw== X-Gm-Message-State: ALoCoQlbNGPSaqQAt5+WQ1pVe8W5y0IRzsMlPhddzu9fFNOQ1+qdwA6QWG5R6OIPq8eAgdFPQyGbhg+rUqdlw92LuE8mnO9bGi9llvOSGvA141a35Wov+VxKwIPKJqcCKtcE9i9gnKF0QvlGnGAjMlr1ZMxywZ21lnzoEjZuEdJVqa0QlIqVqtQ2saPXxxpZaA8Tfhg4ti489fICpFZcaq8dV7cHGYTOKA== MIME-Version: 1.0 X-Received: by 10.49.120.8 with SMTP id ky8mr6213570qeb.29.1387481581866; Thu, 19 Dec 2013 11:33:01 -0800 (PST) Received: by 10.229.127.4 with HTTP; Thu, 19 Dec 2013 11:33:01 -0800 (PST) Date: Thu, 19 Dec 2013 11:33:01 -0800 Message-ID: Subject: [Patch] Fix PR 59542: flow verification after compgotos From: Teresa Johnson To: "gcc-patches@gcc.gnu.org" , Steven Bosscher X-IsSubscribed: yes Computed goto duplication needs to fixup partition boundaries if it performed any block duplication. Bootstrapped and tested on x86_64-unknown-linux-gnu. Ok for trunk? 2013-12-19 Teresa Johnson PR gcov-profile/59542 * bb-reorder.c (duplicate_computed_gotos): Invoke fixup_partitions if we have made any changes. Index: bb-reorder.c =================================================================== --- bb-reorder.c (revision 206100) +++ bb-reorder.c (working copy) @@ -2390,6 +2390,7 @@ duplicate_computed_gotos (void) basic_block bb, new_bb; bitmap candidates; int max_size; + bool changed = false; if (n_basic_blocks_for_fn (cfun) <= NUM_FIXED_BLOCKS + 1) return 0; @@ -2486,9 +2487,17 @@ duplicate_computed_gotos (void) new_bb->aux = bb->aux; bb->aux = new_bb; new_bb->flags |= BB_VISITED; + changed = true; } done: + /* Duplicating blocks above will redirect edges and may cause hot blocks + previously reached by both hot and cold blocks to become dominated only + by cold blocks. This will cause the verification when leaving cfg layout + mode to fail, and lead to now cold code in the hot section. Invoke + fixup_partitions to address these problems. */ + if (changed) + fixup_partitions (); cfg_layout_finalize (); BITMAP_FREE (candidates);