From patchwork Fri Nov 25 08:22:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthil Kumar Selvaraj X-Patchwork-Id: 699096 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 3tQ8JG08Zpz9t1L for ; Fri, 25 Nov 2016 19:24:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="rZ8NjUgb"; 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:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=jUVBhmM5FoHxRjVV87f9yTdtInV9KTcYilII+qcNFsNl3RDr47ura aSz9oUJ7ZRf87X6/2auE9x/RKNl5avYIyVUGdun6tXMs31fA4mSRx/5Xjc95oOjF wuPO4JLWMyJZ3iu/FA5Wai5lBWCnbJpFhESd5KC5VcOU9IQheqoKaE= 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:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=nPcutPb6+wdZDKhP8ougHzdPca0=; b=rZ8NjUgbdm6R7N1sMTtI njfN1tQJm1X3J+ysFVGQ7/zhvYVbXDAE6N/h52rYWvGjJYvAoO6HMJfVhVY9lMes Mdnm92dempDhIKaH6NbUMQQC7NOeodH02BmXRgyp62OVEDw2jJIijXVBvoyT6Csg 9NU8Og5zH0Mt8bx7VIpC9O4= Received: (qmail 3602 invoked by alias); 25 Nov 2016 08:24:34 -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 3462 invoked by uid 89); 25 Nov 2016 08:24:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=2016-11-25 X-HELO: eusmtp01.atmel.com Received: from eusmtp01.atmel.com (HELO eusmtp01.atmel.com) (212.144.249.243) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Nov 2016 08:24:23 +0000 Received: from HNOCHT01.corp.atmel.com (10.145.133.40) by eusmtp01.atmel.com (10.145.145.31) with Microsoft SMTP Server (TLS) id 14.3.235.1; Fri, 25 Nov 2016 09:24:11 +0100 Received: from jaguar.atmel.com (10.145.133.18) by HNOCHT01.corp.atmel.com (10.145.133.40) with Microsoft SMTP Server (TLS) id 14.3.235.1; Fri, 25 Nov 2016 09:24:17 +0100 User-agent: mu4e 0.9.17; emacs 24.5.1 From: Senthil Kumar Selvaraj To: Gcc Patch List Subject: [Patch, testsuite] Fix bogus pr64427.c failure for avr Date: Fri, 25 Nov 2016 13:52:48 +0530 Message-ID: <87d1hkc6jr.fsf@atmel.com> MIME-Version: 1.0 X-IsSubscribed: yes The smaller int size for the avr target breaks the test's expectation on the number of iterations. The failure goes away if 32 bit ints are used in place of a plain int. Fix by conditionally typedef int32_t to __INT32_TYPE__ for targets with int size < 4, and then use int32_t everywhere. Regards Senthil 2016-11-25 Senthil Kumar Selvaraj * gcc.dg/pr64277.c: Use 32 bit int for targets with sizeof(int) < 4. Index: gcc/testsuite/gcc.dg/pr64277.c =================================================================== --- gcc/testsuite/gcc.dg/pr64277.c (revision 242857) +++ gcc/testsuite/gcc.dg/pr64277.c (working copy) @@ -4,10 +4,16 @@ /* { dg-final { scan-tree-dump "loop with 5 iterations completely unrolled" "cunroll" } } */ /* { dg-final { scan-tree-dump "loop with 6 iterations completely unrolled" "cunroll" } } */ -int f1[10]; +#if __SIZEOF_INT__ < 4 + __extension__ typedef __INT32_TYPE__ int32_t; +#else + typedef int int32_t; +#endif + +int32_t f1[10]; void test1 (short a[], short m, unsigned short l) { - int i = l; + int32_t i = l; for (i = i + 5; i < m; i++) f1[i] = a[i]++; } @@ -14,7 +20,7 @@ void test2 (short a[], short m, short l) { - int i; + int32_t i; if (m > 5) m = 5; for (i = m; i > l; i--)