From patchwork Wed Feb 29 03:12:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 143667 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]) by ozlabs.org (Postfix) with SMTP id 5A778B6FD3 for ; Wed, 29 Feb 2012 14:12:37 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331089958; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Message-ID:Subject:From:To: Cc:Date:Content-Type:Content-Transfer-Encoding:Mime-Version: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=p9/YWyNpL6jPejtiOsUb tiMUKoc=; b=MUMQbUN1QDdMal6iqa0uEesbY0+MJvzVn5B9DbAiaC+jee7tMWu0 5R+KcS5AJOe9GQZ6T4xJzihK8XDMnbKup6a6eEB1BRSQ3RxRJQNpWM0ofu6AsoWa 5Pmsfh4bVks7hxbEN8YAJ4RJ6CLi/Hic+3Rl+Bz9mE/VLy2awMzeZ6U= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Received:Received:Message-ID:Subject:From:To:Cc:Date:Content-Type:Content-Transfer-Encoding:Mime-Version:X-Content-Scanned:x-cbid:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=oxf8rvkqUhMe45rVnbUXfo+b76qirF/PuDoxgLuT/0UGBnjVERyZMcSAhAGnAm MFxD3RC8N0fqgsb+k1p13/3dFQOdqx3dfoVe/2sVcvGoevt3YR8PpySrqWcc0r1m yOQJNprFJIkJYaCIctYGo89hmxP/6suBYXXgTn+UUyD7E=; Received: (qmail 9930 invoked by alias); 29 Feb 2012 03:12:33 -0000 Received: (qmail 9921 invoked by uid 22791); 29 Feb 2012 03:12:32 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e8.ny.us.ibm.com (HELO e8.ny.us.ibm.com) (32.97.182.138) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Feb 2012 03:12:18 +0000 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 28 Feb 2012 22:12:17 -0500 Received: from d01dlp02.pok.ibm.com (9.56.224.85) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 28 Feb 2012 22:12:15 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 0A1F46E804D for ; Tue, 28 Feb 2012 22:12:15 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1T3CERO3514514 for ; Tue, 28 Feb 2012 22:12:14 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1T3CDPr019126 for ; Tue, 28 Feb 2012 22:12:14 -0500 Received: from [9.49.216.148] ([9.49.216.148]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q1T3CDMU019087; Tue, 28 Feb 2012 22:12:13 -0500 Message-ID: <1330485140.4317.11.camel@gnopaine> Subject: [PATCH] Fix PR52424 From: "William J. Schmidt" To: gcc-patches@gcc.gnu.org Cc: bergner@vnet.ibm.com Date: Tue, 28 Feb 2012 21:12:20 -0600 Mime-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12022903-9360-0000-0000-000004149CED 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 This patch fixes PR52424 by pushing a missing marker onto const_and_copies_stack before calling dom_thread_across_edge. This bug has resulted in lost copy propagation opportunities in the presence of edge threading. Bootstrapped and tested with no regressions on powerpc64-linux-gnu. I'm waiting on Jiangning Liu to verify the patch fixes his performance concern. Provided it does, is this OK for trunk? Also, this bug has apparently been there for a long time. Should we consider backporting the fix to 4.6 and/or 4.5? Thanks, Bill 2012-02-28 Bill Schmidt PR tree-optimization/52424 * tree-ssa-dom.c (dom_opt_leave_block): Push a marker before calling dom_thread_across_edge. Index: gcc/tree-ssa-dom.c =================================================================== --- gcc/tree-ssa-dom.c (revision 184625) +++ gcc/tree-ssa-dom.c (working copy) @@ -1779,6 +1779,9 @@ dom_opt_leave_block (struct dom_walk_data *walk_da && (single_succ_edge (bb)->flags & EDGE_ABNORMAL) == 0 && potentially_threadable_block (single_succ (bb))) { + /* Push a marker on the stack, which thread_across_edge expects + and will remove. */ + VEC_safe_push (tree, heap, const_and_copies_stack, NULL_TREE); dom_thread_across_edge (walk_data, single_succ_edge (bb)); } else if ((last = last_stmt (bb))