From patchwork Sat Jul 25 08:10:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 499923 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B71CE140320 for ; Sat, 25 Jul 2015 18:10:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=AA8MkChY; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=E674WRexytg8yKNLj WmAau+H+EIR7v2SfsCCMDiHgdkIwbzELPj/FwZEgfWK6SHDUGzLYPHqz9Mw2INXy J6pIvq8OEvGQ4lOMDTX7dfIxSJELrjP5p0Ja3mQC657k0zjN/sn5pvmXvz5DedF4 nMhU0V8ChF6qPAGgVswKNqHtdo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=nbMOw3xCtOzLycI8IHs5BYs TT3o=; b=AA8MkChYXxNiyDkjX9Nskr/AX8jmGYJb8D9yYHeW6CcpESniAi2YRtZ uYK8vIfWTgyBOTrZcmQsfpCWrVjiGBv1idVo4qEy0f2mYb1Pr0pRee/2dVXMjMfZ uJXHHFOK7iOlJCeLvZnqBmJhKCmn1EwW7Qdj1bT9drwgWFkLiCkk= Received: (qmail 72688 invoked by alias); 25 Jul 2015 08:10:43 -0000 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 Received: (qmail 72677 invoked by uid 89); 25 Jul 2015 08:10:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 25 Jul 2015 08:10:41 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42910) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZIuXX-0000BI-76 for gcc-patches@gnu.org; Sat, 25 Jul 2015 04:10:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIuXT-0006xA-9b for gcc-patches@gnu.org; Sat, 25 Jul 2015 04:10:38 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:40181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIuXT-0006wi-0h for gcc-patches@gnu.org; Sat, 25 Jul 2015 04:10:35 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZIuXR-0005wM-3q from Tom_deVries@mentor.com ; Sat, 25 Jul 2015 01:10:33 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Sat, 25 Jul 2015 09:10:31 +0100 Message-ID: <55B34467.4050707@mentor.com> Date: Sat, 25 Jul 2015 10:10:15 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Sebastian Pop , Richard Biener CC: "gcc-patches@gnu.org" Subject: Re: [PATCH] Don't allow unsafe reductions in graphite References: <55A6C1DF.1050108@mentor.com> <20150720183141.GB20717@f1.c.bardezibar.internal> <55AD9093.1060206@mentor.com> <55AE5340.2010700@mentor.com> <20150721184249.GA7417@f1.c.bardezibar.internal> <55AFBE25.5020508@mentor.com> <20150724202007.GA17610@f1.c.bardezibar.internal> In-Reply-To: <20150724202007.GA17610@f1.c.bardezibar.internal> X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 On 24/07/15 22:20, Sebastian Pop wrote: > Richard Biener wrote: >> On Wed, Jul 22, 2015 at 6:00 PM, Tom de Vries wrote: >>> Currently bootstrapping and reg-testing on x86_64. >>> >>> OK for trunk? >>> >>> OK 5 and 4.9 release branches? >> >> Ok if Sebastian is fine with it. > > Ok to backport as well. > Thanks Tom for the patches. And thanks for the review. This follow-up patch: - makes sure that the uns-*.c variants are handled the same as the original ones in graphite.exp. - actually makes the uns-*.c variants use unsigned arithmetic. Committed to trunk. Thanks, - Tom Fixup graphite/uns-*.c testcases 2015-07-25 Tom de Vries * gcc.dg/graphite/graphite.exp: Include uns-*.c files in interchange_files and block_files variables. * gcc.dg/graphite/uns-block-1.c (main): Change signed into unsigned arithmetic. * gcc.dg/graphite/uns-interchange-12.c: Same. * gcc.dg/graphite/uns-interchange-14.c: Same. * gcc.dg/graphite/uns-interchange-15.c: Same. * gcc.dg/graphite/uns-interchange-9.c (foo): Same. * gcc.dg/graphite/uns-interchange-mvt.c: Same. --- gcc/testsuite/gcc.dg/graphite/graphite.exp | 6 ++++-- gcc/testsuite/gcc.dg/graphite/uns-block-1.c | 6 +++--- gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c | 7 ++++--- gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c | 5 +++-- gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c | 7 ++++--- gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c | 11 ++++++----- gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c | 7 ++++--- 7 files changed, 28 insertions(+), 21 deletions(-) diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc.dg/graphite/graphite.exp index 9dba5d6..9e7ede6 100644 --- a/gcc/testsuite/gcc.dg/graphite/graphite.exp +++ b/gcc/testsuite/gcc.dg/graphite/graphite.exp @@ -41,8 +41,10 @@ set wait_to_run_files [lsort [glob -nocomplain $srcdir/$subdir/*.c ] ] set scop_files [lsort [glob -nocomplain $srcdir/$subdir/scop-*.c ] ] set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ] set run_id_files [lsort [glob -nocomplain $srcdir/$subdir/run-id-*.c ] ] -set interchange_files [lsort [glob -nocomplain $srcdir/$subdir/interchange-*.c ] ] -set block_files [lsort [glob -nocomplain $srcdir/$subdir/block-*.c ] ] +set interchange_files [lsort [glob -nocomplain $srcdir/$subdir/interchange-*.c \ + $srcdir/$subdir/uns-interchange-*.c ] ] +set block_files [lsort [glob -nocomplain $srcdir/$subdir/block-*.c \ + $srcdir/$subdir/uns-block-*.c ] ] set vect_files [lsort [glob -nocomplain $srcdir/$subdir/vect-*.c ] ] # Tests to be compiled. diff --git a/gcc/testsuite/gcc.dg/graphite/uns-block-1.c b/gcc/testsuite/gcc.dg/graphite/uns-block-1.c index 57d522b..c50b770 100644 --- a/gcc/testsuite/gcc.dg/graphite/uns-block-1.c +++ b/gcc/testsuite/gcc.dg/graphite/uns-block-1.c @@ -13,9 +13,9 @@ int main (void) { int i, j; - int sum = 0; - int A[MAX * MAX]; - int B[MAX * MAX]; + unsigned int sum = 0; + unsigned int A[MAX * MAX]; + unsigned int B[MAX * MAX]; /* These loops should be loop blocked. */ for (i = 0; i < MAX; i++) diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c index dc26926..bd21ba9 100644 --- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c +++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-12.c @@ -7,9 +7,9 @@ #define N 200 -int A[N][N], B[N][N], C[N][N]; +unsigned int A[N][N], B[N][N], C[N][N]; -static int __attribute__((noinline)) +static unsigned int __attribute__((noinline)) matmult (void) { int i, j, k; @@ -31,7 +31,8 @@ extern void abort (); int main (void) { - int i, j, res; + int i, j; + unsigned int res; for (i = 0; i < N; i++) for (j = 0; j < N; j++) diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c index 36990ab..b1abd13 100644 --- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c +++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-14.c @@ -7,7 +7,7 @@ #define N 200 -int A[N][N], B[N][N], C[N][N]; +unsigned int A[N][N], B[N][N], C[N][N]; static void __attribute__((noinline)) matmult (void) @@ -30,7 +30,8 @@ extern void abort (); int main (void) { - int i, j, res = 0; + int i, j; + unsigned res = 0; for (i = 0; i < N; i++) for (j = 0; j < N; j++) diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c index 3ddb74f..a5a2e27 100644 --- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c +++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-15.c @@ -7,9 +7,9 @@ #define NMAX 2000 -static int x[NMAX], a[NMAX][NMAX]; +static unsigned int x[NMAX], a[NMAX][NMAX]; -static int __attribute__((noinline)) +static unsigned int __attribute__((noinline)) mvt (long N) { int i,j; @@ -27,7 +27,8 @@ extern void abort (); int main (void) { - int i, j, res; + int i, j; + unsigned int res; for (i = 0; i < NMAX; i++) for (j = 0; j < NMAX; j++) diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c index cfec110..6bfd3d6 100644 --- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c +++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-9.c @@ -8,11 +8,11 @@ #define N 111 #define M 111 -static int __attribute__((noinline)) -foo (int *x) +static unsigned int __attribute__((noinline)) +foo (unsigned int *x) { int i, j; - int sum = 0; + unsigned int sum = 0; for (j = 0; j < M; ++j) for (i = 0; i < N; ++i) @@ -26,8 +26,9 @@ extern void abort (); int main (void) { - int A[N*M]; - int i, res; + unsigned int A[N*M]; + int i; + unsigned int res; for (i = 0; i < N*M; i++) A[i] = 2; diff --git a/gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c b/gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c index 4b8f264..80f6789 100644 --- a/gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c +++ b/gcc/testsuite/gcc.dg/graphite/uns-interchange-mvt.c @@ -7,9 +7,9 @@ #define NMAX 2000 -static int x1[NMAX], x2[NMAX], a[NMAX][NMAX], y1[NMAX], y2[NMAX]; +static unsigned int x1[NMAX], x2[NMAX], a[NMAX][NMAX], y1[NMAX], y2[NMAX]; -static int __attribute__((noinline)) +static unsigned int __attribute__((noinline)) mvt (long N) { @@ -32,7 +32,8 @@ extern void abort (); int main (void) { - int i, j, res; + int i, j; + unsigned int res; for (i = 0; i < NMAX; i++) for (j = 0; j < NMAX; j++) -- 1.9.1