From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37959 invoked by alias); 18 Jun 2016 08:59:51 -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 37905 invoked by uid 89); 18 Jun 2016 08:59:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=1756, 58ca, 942b, 4ED5 X-HELO: mail-out.m-online.net Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sat, 18 Jun 2016 08:59:40 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3rWrfJ44n9z3hjRl; Sat, 18 Jun 2016 10:59:36 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3rWrfJ2SS2zvh25; Sat, 18 Jun 2016 10:59:36 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id Sbz8TNf-aBsn; Sat, 18 Jun 2016 10:59:35 +0200 (CEST) X-Auth-Info: BwT6ozxwyhdbRoliuLyCEHNTYediyrVqDtGMmsc4vgNsGbFwVPVi0JOPL/QQ+bEg Received: from linux.local (ppp-88-217-21-96.dynamic.mnet-online.de [88.217.21.96]) by mail.mnet-online.de (Postfix) with ESMTPA; Sat, 18 Jun 2016 10:59:35 +0200 (CEST) Received: by linux.local (Postfix, from userid 501) id 0C08E1E541B; Sat, 18 Jun 2016 10:59:32 +0200 (CEST) From: Andreas Schwab To: Bin Cheng Cc: "gcc-patches\@gcc.gnu.org" , nd Subject: Re: [PATCH PR71347][Partial revert r235513]Compute cost for all uses in group References: X-Yow: I want you to organize my PASTRY trays... my TEA-TINS are gleaming in formation like a ROW of DRUM MAJORETTES -- please don't be FURIOUS with me -- Date: Sat, 18 Jun 2016 08:59:00 -0000 In-Reply-To: (Bin Cheng's message of "Mon, 13 Jun 2016 09:57:24 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2016-06/txt/msg01343.txt.bz2 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: ;; 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."