From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71560 invoked by alias); 21 Mar 2017 12:34:11 -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 71542 invoked by uid 89); 21 Mar 2017 12:34:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=Lay X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.160) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Mar 2017 12:34:09 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwR/bcHRirORRW3yMcVao= X-RZG-CLASS-ID: mo00 Received: from [192.168.0.123] (mail.hightec-rt.com [213.135.1.215]) by smtp.strato.de (RZmta 40.1 DYNA|AUTH) with ESMTPSA id V02728t2LCY40Qv (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Tue, 21 Mar 2017 13:34:04 +0100 (CET) Subject: Re: [Patch, testsuite] Fix failing overflow-1.c for avr To: Senthil Kumar Selvaraj References: <874lymde95.fsf@microchip.com> Cc: "gcc-patches@gcc.gnu.org" From: Georg-Johann Lay Message-ID: <2ba9ff5b-5a2a-ee54-6274-318b41b6a4fa@gjlay.de> Date: Tue, 21 Mar 2017 12:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg01104.txt.bz2 On 21.03.2017 13:31, Georg-Johann Lay wrote: > On 21.03.2017 13:07, Senthil Kumar Selvaraj wrote: >> >> Hi, >> >> The test assumes 32 bit ints, and expects a constant in the >> dump that is only valid for 32 bit ints. This trivial patch >> fixes that by explicitly specifying __UINT32_TYPE__ as the type. >> >> Committed as obvious. >> >> Regards >> Senthil >> >> gcc/testsuite/ChangeLog >> >> 2017-03-21 Senthil Kumar Selvaraj >> >> * gcc.dg/tree-ssa/overflow-1.c: Use __UINT32_TYPE__ for targets >> with sizeof(int) < 4. >> >> diff --git gcc/testsuite/gcc.dg/tree-ssa/overflow-1.c >> gcc/testsuite/gcc.dg/tree-ssa/overflow-1.c >> index e126609c53d9..b664d0f120aa 100644 >> --- gcc/testsuite/gcc.dg/tree-ssa/overflow-1.c >> +++ gcc/testsuite/gcc.dg/tree-ssa/overflow-1.c >> @@ -1,14 +1,20 @@ >> /* { dg-do compile } */ >> /* { dg-options "-O -fdump-tree-optimized" } */ >> >> -int f(unsigned a){ >> - unsigned b=5; >> - unsigned c=a-b; >> +#if __SIZEOF_INT__ < 4 >> + __extension__ typedef __UINT32_TYPE__ uint32_t; >> +#else >> + typedef unsigned uint32_t; > > Dunno if this matters, but it changes the test for 64-bit int. argh, forget my comment :-) > > Johann > >> +#endif >> + >> +int f(uint32_t a){ >> + uint32_t b=5; >> + uint32_t c=a-b; >> return c>a; >> } >> -int g(unsigned a){ >> - unsigned b=32; >> - unsigned c=a+b; >> +int g(uint32_t a){ >> + uint32_t b=32; >> + uint32_t c=a+b; >> return c> } >> >> > >