From patchwork Sun May 5 20:45:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 241526 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 CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D17B92C00E6 for ; Mon, 6 May 2013 06:45:32 +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 :message-id:subject:from:to:cc:date:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=aav 3mD9OYDsk0GyZbbIWLlUJlYjDRPsleDvJxPL4JebQ3jQGoWk2Lnn9FpTknQ4Y9S6 jJHJQ1NS6SPLT353jd9wqKx1yWw/0IAj4DbeDeGQy2J2qQBPgxYBwOBxS8kSeD3r nTXVn07xt9nF5v99bs47Yt8UGZXUuCdDJkPsXVgA= 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 :message-id:subject:from:to:cc:date:content-type :content-transfer-encoding:mime-version; s=default; bh=GmOZKzv8G KGV5xyg4a0RB08lltY=; b=KC8gR9Ik29bsaCfpx8XSAuXGgL4gxG3s6HlHWf+lW zNu23cIEkCME805L+PBJE6ayYW8rDFKjTAi2WTUB/CV7d6pUA1nG9Bx4chqTc3kB tgaM0ayanizYtpb55UBaFxSQpcGDtElBNFnxu4MW7bBaIQysbnMf6Q7xH14HYmg4 2I= Received: (qmail 24963 invoked by alias); 5 May 2013 20:45:26 -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 24952 invoked by uid 89); 5 May 2013 20:45:25 -0000 X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_MED, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, TW_TM autolearn=ham version=3.3.1 Received: from e28smtp03.in.ibm.com (HELO e28smtp03.in.ibm.com) (122.248.162.3) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 05 May 2013 20:45:25 +0000 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 May 2013 02:10:44 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp03.in.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 6 May 2013 02:10:42 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 6065A1258023 for ; Mon, 6 May 2013 02:17:02 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r45Kj8aZ3932668 for ; Mon, 6 May 2013 02:15:09 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r45KjFS1015516 for ; Mon, 6 May 2013 06:45:15 +1000 Received: from [9.76.23.162] (sig-9-76-23-162.mts.ibm.com [9.76.23.162]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r45KjDKS015395; Mon, 6 May 2013 06:45:14 +1000 Message-ID: <1367786717.11638.58.camel@gnopaine> Subject: [PATCH] Fix thinko in SLSR that caused x86 bootstrap failure From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: richard.guenther@gmail.com, bergner@vnet.ibm.com Date: Sun, 05 May 2013 15:45:17 -0500 Mime-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13050520-3864-0000-0000-00000800636D When creating a phi-adjustment along an incoming edge, where the related argument should use the "hidden basis" directly, I created a situation where we double-count the subsequent adjustment based on the candidate's index. The candidate's index shouldn't be taken into account at all for the edge adjustment; it will be handled in relation to the created phi basis. This patch fixes that thinko. I disabled processing of conditional candidates (and associated tests) on Friday night to allow x86 targets to bootstrap cleanly. This patch also reinstates the disabled code. Bootstrapped and tested on powerpc-unknown-linux-gnu and i686-pc-linux-gnu with no new regressions. Ok for trunk? Thanks, Bill gcc: 2013-05-05 Bill Schmidt * gimple-ssa-strength-reduction.c (slsr_process_phi): Re-enable. (find_candidates_in_block): Re-enable slsr_process_phi. (create_phi_basis): Fix double counting of candidate adjustment. gcc/testsuite: 2013-05-05 Bill Schmidt * gcc.dg/tree-ssa/slsr-32.c: Re-enable. * gcc.dg/tree-ssa/slsr-33.c: Likewise. * gcc.dg/tree-ssa/slsr-34.c: Likewise. * gcc.dg/tree-ssa/slsr-35.c: Likewise. * gcc.dg/tree-ssa/slsr-36.c: Likewise. * gcc.dg/tree-ssa/slsr-37.c: Likewise. * gcc.dg/tree-ssa/slsr-38.c: Likewise. Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c (revision 198611) +++ gcc/testsuite/gcc.dg/tree-ssa/slsr-32.c (working copy) @@ -3,7 +3,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ -/* { dg-skip-if "" { *-*-* } } */ int f (int s, int c, int i) Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c (revision 198611) +++ gcc/testsuite/gcc.dg/tree-ssa/slsr-33.c (working copy) @@ -3,7 +3,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ -/* { dg-skip-if "" { *-*-* } } */ int f (int c, int i) Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c (revision 198611) +++ gcc/testsuite/gcc.dg/tree-ssa/slsr-34.c (working copy) @@ -3,7 +3,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ -/* { dg-skip-if "" { *-*-* } } */ extern void g (void); Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c (revision 198611) +++ gcc/testsuite/gcc.dg/tree-ssa/slsr-35.c (working copy) @@ -4,7 +4,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ -/* { dg-skip-if "" { *-*-* } } */ int f (int c, int i) Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c (revision 198611) +++ gcc/testsuite/gcc.dg/tree-ssa/slsr-36.c (working copy) @@ -4,7 +4,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ -/* { dg-skip-if "" { *-*-* } } */ int f (int s, int c, int i) Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c (revision 198611) +++ gcc/testsuite/gcc.dg/tree-ssa/slsr-37.c (working copy) @@ -4,7 +4,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ -/* { dg-skip-if "" { *-*-* } } */ int f (int s, int c, int i) Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c =================================================================== --- gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c (revision 198611) +++ gcc/testsuite/gcc.dg/tree-ssa/slsr-38.c (working copy) @@ -4,7 +4,6 @@ /* { dg-do compile } */ /* { dg-options "-O3 -fdump-tree-optimized" } */ -/* { dg-skip-if "" { *-*-* } } */ int f (int c, int i) Index: gcc/gimple-ssa-strength-reduction.c =================================================================== --- gcc/gimple-ssa-strength-reduction.c (revision 198611) +++ gcc/gimple-ssa-strength-reduction.c (working copy) @@ -657,9 +657,6 @@ add_cand_for_stmt (gimple gs, slsr_cand_t c) *slot = c; } -// FORNOW: Disable conditional candidate processing until bootstrap -// issue can be sorted out for i686-pc-linux-gnu. -#if 0 /* Given PHI which contains a phi statement, determine whether it satisfies all the requirements of a phi candidate. If so, create a candidate. Note that a CAND_PHI never has a basis itself, but @@ -750,7 +747,6 @@ slsr_process_phi (gimple phi, bool speed) /* Add the candidate to the statement-candidate mapping. */ add_cand_for_stmt (phi, c); } -#endif /* Look for the following pattern: @@ -1523,12 +1519,8 @@ find_candidates_in_block (struct dom_walk_data *wa bool speed = optimize_bb_for_speed_p (bb); gimple_stmt_iterator gsi; -// FORNOW: Disable conditional candidate processing until bootstrap -// issue can be sorted out for i686-pc-linux-gnu. -#if 0 for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) slsr_process_phi (gsi_stmt (gsi), speed); -#endif for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) { @@ -2098,7 +2090,7 @@ create_phi_basis (slsr_cand_t c, gimple from_phi, feeding_def = gimple_assign_lhs (basis->cand_stmt); else { - double_int incr = c->index - basis->index; + double_int incr = -basis->index; feeding_def = create_add_on_incoming_edge (c, basis_name, incr, e, loc, known_stride); }