From patchwork Thu Aug 12 06:13:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ira Rosen X-Patchwork-Id: 61532 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 EE4AAB70DB for ; Thu, 12 Aug 2010 16:14:07 +1000 (EST) Received: (qmail 8915 invoked by alias); 12 Aug 2010 06:14:03 -0000 Received: (qmail 8889 invoked by uid 22791); 12 Aug 2010 06:14:00 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Aug 2010 06:13:55 +0000 Received: from d12nrmr1507.megacenter.de.ibm.com (d12nrmr1507.megacenter.de.ibm.com [9.149.167.1]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id o7C6DqIT030417 for ; Thu, 12 Aug 2010 06:13:52 GMT Received: from d12av05.megacenter.de.ibm.com (d12av05.megacenter.de.ibm.com [9.149.165.216]) by d12nrmr1507.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7C6Dqwi2158788 for ; Thu, 12 Aug 2010 08:13:52 +0200 Received: from d12av05.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av05.megacenter.de.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7C6Dpo8020531 for ; Thu, 12 Aug 2010 08:13:51 +0200 Received: from d12mc102.megacenter.de.ibm.com (d12nrml1506.megacenter.de.ibm.com [9.149.165.56] (may be forged)) by d12av05.megacenter.de.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o7C6DpMw020528; Thu, 12 Aug 2010 08:13:51 +0200 In-Reply-To: References: Subject: Re: [Patch PR 45241]: CPU2006 465.tonto ICE in the vectorizer with -fno-tree-pre X-KeepSent: 95A4C39E:B52F9EC9-C225777D:00212EAE; type=4; name=$KeepSent To: "Fang, Changpeng" Cc: "gcc-patches@gcc.gnu.org" Message-ID: From: Ira Rosen Date: Thu, 12 Aug 2010 09:13:34 +0300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-IsSubscribed: yes 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 "Fang, Changpeng" wrote on 11/08/2010 08:36:42 PM: > Hi, > > Attached patch fixes bug 45241: CPU2006 465.tonto ICE in the > vectorizer with -fno-tree-pre. > > When the vectorizer tries to recognize the dot_prod pattern, it > traces the statements chain > outside the loop. As a result, ICE occurs when it tries to access > the stmt_vinfo for a stmt > outside the loop. > > This patch stops the pattern searching when the statement is already > outside the loop. > It passed bootstrapping in both the trunk and 4.5 branch. On which target? What about regtesting? > > The bug is 4.5/4.6 regression, and it prevents benchmarking for > cpu2006 with no PRE. > > Is it OK to commit to 4,5 branch (and 4.6 ? > > Thanks, > > Changpeng > * gcc/tree-vect-patterns.c (vect_recog_dot_prod_pattern): Give No need in gcc/ before tree-vect-patterns.c. up dor_prod pattern searching if a stmt is outside the loop. dot prod * gcc.dg/vect/pr45241.c: New. --- gcc/testsuite/gcc.dg/vect/pr45241.c | 19 +++++++++++++++++++ gcc/tree-vect-patterns.c | 5 +++++ 2 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/vect/pr45241.c + + return sum; +} + Please add /* { dg-final { cleanup-tree-dump "vect" } } */ to the test. Thanks, Ira diff --git a/gcc/testsuite/gcc.dg/vect/pr45241.c b/gcc/testsuite/gcc.dg/vect/pr45241.c new file mode 100644 index 0000000..c04cf04 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr45241.c @@ -0,0 +1,19 @@ +/* PR tree-optimization/45241 */ +/* { dg-do compile } */ +/* { dg-options "-O3 -ftree-pre" } */ Instead of using dg-options please change the name of the test to no-tree-pre-pr45241.c. + +int +foo (short x) +{ + short i, y; + int sum; + + for (i = 0; i < x; i++) + y = x * i; + + for (i = x; i > 0; i--) + sum += y;