From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19436 invoked by alias); 28 Mar 2017 10:58:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 19418 invoked by uid 89); 28 Mar 2017 10:58:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:AES256-SHA, Hx-spam-relays-external:sk:smtpout, H*RU:sk:smtpout, H*r:sk:smtpout X-HELO: esa1.microchip.iphmx.com Received: from Unknown (HELO esa1.microchip.iphmx.com) (68.232.147.91) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Mar 2017 10:58:50 +0000 Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA; 28 Mar 2017 03:58:43 -0700 Received: from jaguar.microchip.com (10.10.76.4) by chn-sv-exch05.mchp-main.com (10.10.76.106) with Microsoft SMTP Server id 14.3.181.6; Tue, 28 Mar 2017 03:58:42 -0700 User-agent: mu4e 0.9.18; emacs 25.1.1 From: Senthil Kumar Selvaraj To: "gcc-patches@gcc.gnu.org" Subject: [Patch, testsuite] Fix more failing tests for avr Date: Tue, 28 Mar 2017 12:01:00 -0000 Message-ID: <87vaqtfz2t.fsf@microchip.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-03/txt/msg01440.txt.bz2 Hi, The below trivial patch fixes some more testsuite failures for the avr target. They fail for avr because they assume ints are 32 bits or wider. The patch uses explicit __{U}INT32_TYPE__ for targets with smaller int size. Committed as obvious. Regards Senthil 2017-03-28 Senthil Kumar Selvaraj * gcc.c-torture/execute/pr79121.c:Use __{U}INT32_TYPE__ for targets with sizeof(int) < 4. * gcc.c-torture/execute/pr79737-1.c (struct S): Likewise. * gcc.c-torture/execute/pr79737-2.c: Likewise. * gcc.dg/torture/pr79777.c: Likewise. * gcc.dg/torture/pr79910.c: Likewise. Index: gcc.c-torture/execute/pr79121.c =================================================================== --- gcc.c-torture/execute/pr79121.c (revision 246528) +++ gcc.c-torture/execute/pr79121.c (working copy) @@ -1,21 +1,29 @@ +#if __SIZEOF_INT__ < 4 + __extension__ typedef __UINT32_TYPE__ uint32_t; + __extension__ typedef __INT32_TYPE__ int32_t; +#else + typedef unsigned uint32_t; + typedef int int32_t; +#endif + extern void abort (void); -__attribute__ ((noinline, noclone)) unsigned long long f1 (int x) +__attribute__ ((noinline, noclone)) unsigned long long f1 (int32_t x) { return ((unsigned long long) x) << 4; } -__attribute__ ((noinline, noclone)) long long f2 (unsigned x) +__attribute__ ((noinline, noclone)) long long f2 (uint32_t x) { return ((long long) x) << 4; } -__attribute__ ((noinline, noclone)) unsigned long long f3 (unsigned x) +__attribute__ ((noinline, noclone)) unsigned long long f3 (uint32_t x) { return ((unsigned long long) x) << 4; } -__attribute__ ((noinline, noclone)) long long f4 (int x) +__attribute__ ((noinline, noclone)) long long f4 (int32_t x) { return ((long long) x) << 4; } Index: gcc.c-torture/execute/pr79737-1.c =================================================================== --- gcc.c-torture/execute/pr79737-1.c (revision 246528) +++ gcc.c-torture/execute/pr79737-1.c (working copy) @@ -1,13 +1,19 @@ /* PR tree-optimization/79737 */ +#if __SIZEOF_INT__ < 4 + __extension__ typedef __INT32_TYPE__ int32_t; +#else + typedef int int32_t; +#endif + #pragma pack(1) struct S { - int b:18; - int c:1; - int d:24; - int e:15; - int f:14; + int32_t b:18; + int32_t c:1; + int32_t d:24; + int32_t e:15; + int32_t f:14; } i; int g, j, k; static struct S h; Index: gcc.c-torture/execute/pr79737-2.c =================================================================== --- gcc.c-torture/execute/pr79737-2.c (revision 246528) +++ gcc.c-torture/execute/pr79737-2.c (working copy) @@ -1,13 +1,19 @@ /* PR tree-optimization/79737 */ +#if __SIZEOF_INT__ < 4 + __extension__ typedef __INT32_TYPE__ int32_t; +#else + typedef int int32_t; +#endif + #pragma pack(1) struct S { - int b:18; - int c:1; - int d:24; - int e:15; - int f:14; + int32_t b:18; + int32_t c:1; + int32_t d:24; + int32_t e:15; + int32_t f:14; } i, j; void Index: gcc.dg/torture/pr79777.c =================================================================== --- gcc.dg/torture/pr79777.c (revision 246528) +++ gcc.dg/torture/pr79777.c (working copy) @@ -1,9 +1,14 @@ /* { dg-do compile } */ typedef unsigned short __u16; -typedef unsigned int __u32; +#if __SIZEOF_INT__ < 4 + __extension__ typedef __UINT32_TYPE__ __u32; + __extension__ typedef __UINT32_TYPE__ u32; +#else + typedef unsigned int __u32; + typedef unsigned int u32; +#endif typedef unsigned char u8; -typedef unsigned int u32; typedef __u16 __le16; typedef __u32 __le32; typedef u32 secno; Index: gcc.dg/torture/pr79910.c =================================================================== --- gcc.dg/torture/pr79910.c (revision 246528) +++ gcc.dg/torture/pr79910.c (working copy) @@ -2,7 +2,11 @@ /* { dg-additional-options "-fweb" } */ typedef unsigned char u8; -typedef unsigned int u32; +#if __SIZEOF_INT__ < 4 + __extension__ typedef __UINT32_TYPE__ u32; +#else + typedef unsigned int u32; +#endif typedef unsigned long long u64; int a;