From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77826 invoked by alias); 20 Jun 2016 08:18:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 77814 invoked by uid 89); 20 Jun 2016 08:18:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=1756, 8276, 54C7, 6D53 X-HELO: mail-qk0-f174.google.com Received: from mail-qk0-f174.google.com (HELO mail-qk0-f174.google.com) (209.85.220.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 20 Jun 2016 08:18:30 +0000 Received: by mail-qk0-f174.google.com with SMTP id p10so152357787qke.3 for ; Mon, 20 Jun 2016 01:18:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9QzcWIjcsrr2fqM5esHvZvcf8isx/1qG+Y4Se6fstsE=; b=gVpeHzQZaE9wFSs14XR+zPRfA2CcWfk78SotXfc982O7rXlJeSK5cThAUwNHj9G5Yo AZSPi0KLmKF+f5IHwKSj1jrwHznvIuKvOqdMKDLoathGl7xxXFIO+/dxsPnOhGHsPs5x pD4mMvhzcGF7iKizlWFplxqpl8fUikYENqjEKBUNw48rdVxtCQO6SbcHWHhGWGArMkE2 gelyQ6oCq0msVBtfotYTx5TNHAd8i7ezPUZR3yAy4LP2vKewj2Y/MuDtRd53M39uLApH iPuRLaovmqqBOphKvTz1UuIJfiM0oQoxwRch6URjS+wINbaVc+/UXuxGg9sg9r8Yq9yN p5bQ== X-Gm-Message-State: ALyK8tIES5vgCELdfw82slPrPMnqbaLPVQBaXCMCEYzQxWAKIx1qAve+I9AkDrbAaeOQhQzoVHCw1eKJVX62sGhh X-Received: by 10.55.167.133 with SMTP id q127mr20003174qke.95.1466410708435; Mon, 20 Jun 2016 01:18:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.99.78 with HTTP; Mon, 20 Jun 2016 01:18:27 -0700 (PDT) In-Reply-To: References: From: Christophe Lyon Date: Mon, 20 Jun 2016 08:18:00 -0000 Message-ID: Subject: Re: [PATCH PR71347][Partial revert r235513]Compute cost for all uses in group To: Andreas Schwab Cc: Bin Cheng , "gcc-patches@gcc.gnu.org" , nd Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg01374.txt.bz2 On 18 June 2016 at 10:59, Andreas Schwab wrote: > Bin Cheng writes: > >> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr71347.c b/gcc/testsuite/gcc.dg/tree-ssa/pr71347.c >> new file mode 100644 >> index 0000000..7e5ad49 >> --- /dev/null >> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr71347.c >> @@ -0,0 +1,17 @@ >> +/* { dg-do compile } */ >> +/* { dg-options "-O2 -fdump-tree-optimized" } */ >> + >> +double in; >> +extern void Write (double); >> +void foo (void) >> +{ >> + static double X[9]; >> + int i; >> + X[1] = in * in; >> + for (i = 2; i <= 8; i++) >> + X[i] = X[i - 1] * X[1]; >> + Write (X[5]); >> +} >> + >> +/* Load of X[i - i] can be omitted by reusing X[i] in previous iteration. */ >> +/* { dg-final { scan-tree-dump-not ".* = MEM.*;" "optimized"} } */ > > The test fails on ia64, this is what I get in .optimized: > The test passes on aarch64, but fails on arm targets. Maybe that's easier for Bin to reproduce? Christophe > ;; Function foo (foo, funcdef_no=0, decl_uid=1387, cgraph_uid=0, symbol_order=1) > > foo () > { > int i; > static double X[9]; > double in.0_1; > double in.1_2; > double _3; > int _4; > double _5; > double _6; > double _7; > double _8; > > : > in.0_1 = in; > in.1_2 = in; > _3 = in.0_1 * in.1_2; > X[1] = _3; > i_13 = 2; > goto ; > > : > _4 = i_9 + -1; > _5 = X[_4]; > _6 = X[1]; > _7 = _5 * _6; > X[i_9] = _7; > i_15 = i_9 + 1; > > : > # i_9 = PHI > if (i_9 <= 8) > goto ; > else > goto ; > > : > _8 = X[5]; > Write (_8); > return; > > } > > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 > "And now for something completely different."