From patchwork Thu Aug 4 07:24:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathamesh Kulkarni X-Patchwork-Id: 73240 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1246814qga; Thu, 4 Aug 2016 00:24:49 -0700 (PDT) X-Received: by 10.66.237.71 with SMTP id va7mr97795188pac.5.1470295489639; Thu, 04 Aug 2016 00:24:49 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l3si13220713paz.233.2016.08.04.00.24.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Aug 2016 00:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-433151-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-433151-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-433151-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=sa3ek5J7w78QfTu 91KBq81danK1VtmqOUY+xEl8TwwFlJ+yBgRqh8HCjiGDZvsuJGrkCj3mBGtHdoRp 4LPq8SZOJqI4nQWsrnfUxVBaSUsUTebbxZiZ/uzukj+H6EvHwJdLxP59H6CyQro0 +c9c1RGPeV7aTOSsC3MwkAfVogBU= 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=k/UZEBZdxVlylFNfpjDV6 MHPil4=; b=o+zITOdHhgWqbGnWZSkunWhaDKTMXI32aXnnbiP059CMPA1uuda5E oQBO8OXCAyPLb7mp9yT1SuAkHeErppIwGn2Iupr0SQKMgEZ1jdFeqHlknFKWxSMe fMmB3Dm+Ca92iOpEMND/xUAy3z7K38TxCL6df/+xp3v+4BVnL7ZSOk= Received: (qmail 73219 invoked by alias); 4 Aug 2016 07:24:33 -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 73183 invoked by uid 89); 4 Aug 2016 07:24:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-it0-f45.google.com Received: from mail-it0-f45.google.com (HELO mail-it0-f45.google.com) (209.85.214.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 04 Aug 2016 07:24:19 +0000 Received: by mail-it0-f45.google.com with SMTP id j124so255877522ith.1 for ; Thu, 04 Aug 2016 00:24:19 -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=KLJcXmL1lcGH2q577KwaC3/grqi1pGlMilJO7GX3oeQ=; b=RGRpO+nLw5uq1I4K3cPv1nd9TzXfiCSqhvmYGsD4bcETjai2Mui7hUqzhyth5Rr5Bl o/QsL/q02O/gKwIPXUWioAlA/Q1Xn7AJS0YKdw4UkJulCW06qsqH+dNOhNjuNA4sOA/W TNVPUUVrOeBn6x/3aZ5+hkcUF0hKIZNSJbxitW889lp6afCsAGHgKjI1vRUs24lRH4MM LO2C1aIn/GzCgPush/7Y1BS3Tds6MSCuzFc4SPa7d8lCo0wqNc/qnTjpHIcOitcECgki sqfzM5OKX3XgBRh4wbn74yfo8h3tqtM9Onl02qGWyHQq5dl6gcJDfLRRHvzvdjyCDS1d M2Jg== X-Gm-Message-State: AEkoouvxGCzaBbpHqmnkyrEnqhB0vVNsVc/rAdfRy0hyOWKtT93qVFocC8QwNTHJUEL5H3nHFMdFLVzDRWAn8YTG X-Received: by 10.36.130.135 with SMTP id t129mr27579802itd.31.1470295457462; Thu, 04 Aug 2016 00:24:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.208.18 with HTTP; Thu, 4 Aug 2016 00:24:16 -0700 (PDT) In-Reply-To: References: <57A1DC2A.8080101@foss.arm.com> From: Prathamesh Kulkarni Date: Thu, 4 Aug 2016 12:54:16 +0530 Message-ID: Subject: Re: [PR70920] transform (intptr_t) x eq/ne CST to x eq/ne (typeof x) cst To: Richard Biener Cc: Matthew Wahab , Andreas Schwab , gcc Patches X-IsSubscribed: yes On 4 August 2016 at 12:39, Richard Biener wrote: > On Thu, 4 Aug 2016, Prathamesh Kulkarni wrote: > >> 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 ? > > I believe the canonical place is after do-do but before dg-options. > Can you check if that works, too? Yes that works. Should I commit the attached patch ? Thanks, Prathamesh > > Richard. > >> Thanks, >> Prathamesh >> > >> > Matthew >> > >> > > -- > Richard Biener > SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg) diff --git a/gcc/testsuite/gcc.dg/pr70920-4.c b/gcc/testsuite/gcc.dg/pr70920-4.c index ab2748b..e9c2b95 100644 --- a/gcc/testsuite/gcc.dg/pr70920-4.c +++ b/gcc/testsuite/gcc.dg/pr70920-4.c @@ -1,5 +1,5 @@ -/* { dg-require-effective-target lp64 } */ /* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ /* { dg-options "-O2 -fdump-tree-forwprop-details -Wno-int-to-pointer-cast" } */ #include