From patchwork Wed Aug 3 22:17:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Kulkarni X-Patchwork-Id: 73229 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1083434qga; Wed, 3 Aug 2016 15:17:55 -0700 (PDT) X-Received: by 10.66.138.74 with SMTP id qo10mr119762074pab.135.1470262675722; Wed, 03 Aug 2016 15:17:55 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q8si10883414pfk.31.2016.08.03.15.17.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2016 15:17:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-433124-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-433124-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-433124-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; q=dns; s=default; b=FQM9dWsrsh8TiHf 2qqkqJhIDg2Y+chl17cV5IbpOOYAlVpCzf2tFLlPofimhMoOIzOO2lUSqy21o0+D NJogNL7jaKsk45bT2kR7YrvoTd5rfGKnlXlLXasOcoUrj5v6NWWpAQ7EFV9DAQHH p6qOSXwP63t5DCfB53AozitpG3YI= 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 :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; s=default; bh=UJuNt4pshT3iNAIS8qf4g 5eaROg=; b=Xj54UVu2b1ygr61p3DHrAOxbfOL0dBqrpiDgRrvfkR6vv0K4uvPrE GXfHy5g2xRjwrMbo3kwafMiDVE+09IpG5nLyzLOiIWBGUzjkZYYQ4Oka7RFeuiHW hdOvgB8myEtBlzWuqMK3jGPHDDJhWrClhdZUCAjRbISznI2RkTAE2A= Received: (qmail 99038 invoked by alias); 3 Aug 2016 22:17: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 99027 invoked by uid 89); 3 Aug 2016 22:17:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-io0-f178.google.com Received: from mail-io0-f178.google.com (HELO mail-io0-f178.google.com) (209.85.223.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 03 Aug 2016 22:17:32 +0000 Received: by mail-io0-f178.google.com with SMTP id q83so257265736iod.1 for ; Wed, 03 Aug 2016 15:17:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oWaAseEG7OKcytJMRsEww9Bgk63oo7VsMFpgw+ecvXM=; b=Dl0/mIt9IXxEdA0pmNaUSCnrbNw4GMuw0Pf0gO8SMsPUlhMANZu+SGURJoSX11QpIq qKT8QB6cKbAVr6o1XBfPX72M150tZ7hsbopKIVckdn7nLtp8YRMrCeYyCZTFLtOX0z2E 5BIyrknNFWHewJ48wzMIA4x+hdz6YKBIMz63B//hXTvZUz7m6gCQuMPjtAeE5PSYQwl2 jssZQPQzDXqCKsdcw2Fx/VzhnDGiVSmc0bh4s+iHELqmv6I14OHhUhcF/OfmP1XzDPBS XPmg4GSf1ws5Fj1Msmue818/HFZbwiPhLVKIunOnrfbNzZDzbcGXv4KjVq7TlJTXgLuD jNow== X-Gm-Message-State: AEkoouuzt3FqAvfcbIPZ0hDDNX2c+j850YU/g2pHAboDz3t/tDEoaLTBWt7X7jzNFZ9Fcqs++lCec7CuINRiAwEK X-Received: by 10.107.14.2 with SMTP id 2mr66800634ioo.181.1470262650735; Wed, 03 Aug 2016 15:17:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.208.18 with HTTP; Wed, 3 Aug 2016 15:17:30 -0700 (PDT) In-Reply-To: <57A1DC2A.8080101@foss.arm.com> References: <57A1DC2A.8080101@foss.arm.com> From: Prathamesh Kulkarni Date: Thu, 4 Aug 2016 03:47:30 +0530 Message-ID: Subject: Re: [PR70920] transform (intptr_t) x eq/ne CST to x eq/ne (typeof x) cst To: Matthew Wahab Cc: Richard Biener , Andreas Schwab , gcc Patches X-IsSubscribed: yes On 3 August 2016 at 17:27, Matthew Wahab wrote: > On 29/07/16 15:32, Prathamesh Kulkarni wrote: >> >> On 29 July 2016 at 12:42, Richard Biener wrote: >>> >>> On Fri, 29 Jul 2016, Prathamesh Kulkarni wrote: >>> >>>> On 28 July 2016 at 19:18, Richard Biener wrote: >>>>> >>>>> On Thu, 28 Jul 2016, Prathamesh Kulkarni wrote: >>>>> >>>>>> On 28 July 2016 at 15:58, Andreas Schwab wrote: >>>>>>> >>>>>>> On Mo, Jul 25 2016, Prathamesh Kulkarni >>>>>>> wrote: >>>>>>> >>>>>>>> diff --git a/gcc/testsuite/gcc.dg/pr70920-4.c >>>>>>>> b/gcc/testsuite/gcc.dg/pr70920-4.c >>>>>>>> new file mode 100644 >>>>>>>> index 0000000..dedb895 >>>>>>>> --- /dev/null >>>>>>>> +++ b/gcc/testsuite/gcc.dg/pr70920-4.c >>>>>>>> @@ -0,0 +1,21 @@ >>>>>>>> +/* { dg-do compile } */ >>>>>>>> +/* { dg-options "-O2 -fdump-tree-ccp-details >>>>>>>> -Wno-int-to-pointer-cast" } */ >>>>>>>> + >>>>>>>> +#include >>>>>>>> + >>>>>>>> +void f1(); >>>>>>>> +void f2(); >>>>>>>> + >>>>>>>> +void >>>>>>>> +foo (int a) >>>>>>>> +{ >>>>>>>> + void *cst = 0; >>>>>>>> + if ((int *) a == cst) >>>>>>>> + { >>>>>>>> + f1 (); >>>>>>>> + if (a) >>>>>>>> + f2 (); >>>>>>>> + } >>>>>>>> +} >>>>>>>> + >>>>>>>> +/* { dg-final { scan-tree-dump "gimple_simplified to if >>>>>>>> \\(_\[0-9\]* == 0\\)" "ccp1" } } */ >>>>>>> >>>>>>> >>>>>>> This fails on all ilp32 platforms. > > [..] >>> >>> >>> I don't think just matching == 0 is a good idea. I suggest to >>> restrict the testcase to lp64 targets and maybe add a ilp32 variant. >> >> Hi, >> I restricted the test-case to lp64 targets. >> Is this OK to commit ? > > > Hello, > > The test case is failing for arm-none-linux-gnueabihf. Oops, sorry about that. > > It is correctly skipped if the 'dg-require-effective-target lp64' you added > is moved to the end of the directives (after the dg-options). Indeed, it is skipped after moving to end. Is it OK to commit the attached patch ? Thanks, Prathamesh > > Matthew > diff --git a/gcc/testsuite/gcc.dg/pr70920-4.c b/gcc/testsuite/gcc.dg/pr70920-4.c index ab2748b..c83ebf9 100644 --- a/gcc/testsuite/gcc.dg/pr70920-4.c +++ b/gcc/testsuite/gcc.dg/pr70920-4.c @@ -1,6 +1,6 @@ -/* { dg-require-effective-target lp64 } */ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-forwprop-details -Wno-int-to-pointer-cast" } */ +/* { dg-require-effective-target lp64 } */ #include