From patchwork Wed Aug 18 14:05:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Belagod X-Patchwork-Id: 62042 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 E1D23B6EEA for ; Thu, 19 Aug 2010 00:05:34 +1000 (EST) Received: (qmail 15182 invoked by alias); 18 Aug 2010 14:05:33 -0000 Received: (qmail 15171 invoked by uid 22791); 18 Aug 2010 14:05:32 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cam-admin0.cambridge.arm.com (HELO cam-admin0.cambridge.arm.com) (217.140.96.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Aug 2010 14:05:08 +0000 Received: from cam-owa2.Emea.Arm.com (cam-owa2.emea.arm.com [10.1.105.18]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id o7IE46F9010485 for ; Wed, 18 Aug 2010 15:04:06 +0100 (BST) Received: from [10.1.67.25] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 18 Aug 2010 15:05:05 +0100 Subject: [Patch] Fix vectorization test case. From: tejas belagod To: gcc-patches@gcc.gnu.org Date: Wed, 18 Aug 2010 15:05:04 +0100 Message-Id: <1282140304.15098.5.camel@e102484-lin.cambridge.arm.com> Mime-Version: 1.0 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 Hi, One of the loops in gcc/testsuite/gcc.dg/vect/vect-1.c is suspect. A two-level nested loop in foo() uses the same index variable for both loops, but uses a different variable to access the matrix inside the loop. I presume this is a typo as this loop is expected to vectorize. Attached is a patch that fixes this. --- Tejas Belagod ARM. gcc/testsuite 2010-08-18 Tejas Belagod * gcc.dg/vect/vect-1.c (foo): Change loop index variable. Index: vect-1.c =================================================================== --- vect-1.c (revision 163337) +++ vect-1.c (working copy) @@ -37,7 +37,7 @@ /* Vectorizable. */ diff = 0; for (i = 0; i < N; i++) { - for (i = 0; i < N; i++) { + for (j = 0; j < N; j++) { diff += (image[i][j] - block[i][j]); } }