From patchwork Tue Dec 7 01:30:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 74485 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 4AF22B70DE for ; Tue, 7 Dec 2010 12:30:16 +1100 (EST) Received: (qmail 13569 invoked by alias); 7 Dec 2010 01:30:14 -0000 Received: (qmail 13559 invoked by uid 22791); 7 Dec 2010 01:30:13 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Dec 2010 01:30:09 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 06 Dec 2010 17:30:07 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 06 Dec 2010 17:30:07 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id E8E5B1808D9; Mon, 6 Dec 2010 17:30:06 -0800 (PST) Date: Mon, 6 Dec 2010 17:30:06 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: PATCH: Add testcases for PRs middle-end/41562/46185 Message-ID: <20101207013006.GA21173@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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, I checked in this patch to add testcases for PRs middle-end/41562/46185. H.J. Index: gcc.dg/graphite/pr46185.c =================================================================== --- gcc.dg/graphite/pr46185.c (revision 0) +++ gcc.dg/graphite/pr46185.c (revision 0) @@ -0,0 +1,46 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -floop-interchange -ffast-math -fno-ipa-cp" } */ + +#define DEBUG 0 +#if DEBUG +#include +#endif + +double u[1782225]; + +static int __attribute__((noinline)) +foo (int N, int *res) +{ + int i, j; + double sum = 0; + for (i = 0; i < N; i++) + for (j = 0; j < N; j++) + sum = sum + u[i + 1335 * j]; + + for (i = 0; i < N; i++) + u[1336 * i] *= 2; + + *res = sum + N + u[1336 * 2] + u[1336]; +} + +extern void abort (); + +int +main (void) +{ + int i, j, res; + + for (i = 0; i < 1782225; i++) + u[i] = 2; + + foo (1335, &res); + +#if DEBUG + fprintf (stderr, "res = %d \n", res); +#endif + + if (res != 3565793) + abort (); + + return 0; +} Index: ChangeLog =================================================================== --- ChangeLog (revision 167526) +++ ChangeLog (working copy) @@ -1,3 +1,11 @@ +2010-12-06 H.J. Lu + + PR middle-end/41562 + * g++.dg/graphite/pr41562.C: New. + + PR middle-end/46185 + * gcc.dg/graphite/pr46185.c: New. + 2010-12-06 Nicola Pero * objc.dg/foreach-8.m: New. Index: g++.dg/graphite/pr41562.C =================================================================== --- g++.dg/graphite/pr41562.C (revision 0) +++ g++.dg/graphite/pr41562.C (revision 0) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O -ftree-loop-distribution -floop-block" } */ + +typedef struct stSirenEncoder { } *SirenEncoder; + +int Siren7_EncodeFrame(SirenEncoder encoder, unsigned char *DataIn, unsigned char *DataOut) { + int number_of_regions; + static int absolute_region_power_index[28] = {0}; + static int region_mlt_bit_counts[28] = {0}; + int dwRes = 0; + int region; + if (dwRes != 0) return dwRes; + for(region = 0; region < number_of_regions; region++) + { + absolute_region_power_index[region] += 24; + region_mlt_bit_counts[region] = 0; + } +}