From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80118 invoked by alias); 31 Oct 2015 17:56:42 -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 80080 invoked by uid 89); 31 Oct 2015 17:56:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wm0-f47.google.com Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 31 Oct 2015 17:56:39 +0000 Received: by wmeg8 with SMTP id g8so32492723wme.1 for ; Sat, 31 Oct 2015 10:56:36 -0700 (PDT) X-Received: by 10.28.142.193 with SMTP id q184mr4260254wmd.15.1446314196794; Sat, 31 Oct 2015 10:56:36 -0700 (PDT) Received: from android-4c5a376a18c0e957.fritz.box (p5B0E5FA0.dip0.t-ipconnect.de. [91.14.95.160]) by smtp.gmail.com with ESMTPSA id ka10sm13114018wjc.30.2015.10.31.10.56.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Oct 2015 10:56:36 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: <1693727.sAndYEapaL@polaris> References: <20151014162944.GE16672@kam.mff.cuni.cz> <1739286.yXNLCe3m6q@polaris> <20151030151759.GJ37773@kam.mff.cuni.cz> <1693727.sAndYEapaL@polaris> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: Add VIEW_CONVERT_EXPR to operand_equal_p From: Richard Biener Date: Sat, 31 Oct 2015 17:58:00 -0000 To: Eric Botcazou ,Jan Hubicka CC: gcc-patches@gcc.gnu.org Message-ID: <2A191FEA-C08A-4BEF-8AB5-420487E703CC@gmail.com> X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg03493.txt.bz2 On October 31, 2015 6:17:35 PM GMT+01:00, Eric Botcazou wrote: >> Lets go with this patch and hopefully stabilize the tree. I don't >think the >> vector conversions represent an important case. > >Unfortunately the patch introduces GIMPLE checking failures in Ada so >it will >need to be completed/improved. But let's postpone it because we have >another >class of GIMPLE checking failures introduced by the >useless_type_conversion_p >change itself: > >c37213j.adb:21:05: warning: variable "X" is read but never assigned >c37213j.adb: In function 'C37213J.PROC.CONSTPROP': >c37213j.adb:41:4: error: invalid conversion in gimple call >struct c37213j__proc__value___PAD > >struct c37213j__proc__value___PAD > ># .MEM_38 = VDEF <.MEM_37> >MEM[(struct c37213j__proc__value___PAD *)R.12_25] = c37213j.proc.value >(); >[static-chain: &FRAME.39] [return slot optimization] > >and: > >eric@polaris:~/build/gcc/native> ~/install/gnat-head/bin/gcc -S >c37213j.adb - >O2 >c37213j.adb:21:05: warning: variable "X" is read but never assigned >c37213j.adb: In function 'C37213J.PROC.VALUE': >c37213j.adb:26:5: error: invalid conversion in return statement >struct c37213j__proc__value___PAD > >struct c37213j__proc__value___PAD > ># VUSE <.MEM_11> >return _9(D); > >What happens here is that GIMPLE statements are remapped through >cloning and >we have a variably-modified type returned by a nested function, so the >type of >the LHS of a GIMPLE_CALL or that of the RHS of a GIMPLE_RETURN is >remapped but >of course not the return type of the function. This used to be OK >because >remapping is done by means of copy_node and preserves TYPE_CANONICAL, >so the >conversion between remapped and original type was deemed useless; now >the >TYPE_CANONICAL check is gone so the conversion is not useless >anymore... > >I don't think that we want to introduce an artificial VCE to fix this >so we >probably need a couple of kludges in the GIMPLE verifier instead. > >In any case, the more I look into the fallout of the >useless_type_conversion_p >change, the more I find it ill-advised. We used to have a solid type >system >in the middle-end by means of the predicate and now we have cases for >which it >ought to return false and returns true (e.g. non-structurally >equivalent types >with different calling conventions) and cases for which it can return >true and >returns false (remapped types or types deemed equivalent by the >languages). >I don't really know what it was made for, but there must be a better >way... I suggest to re-instantiate the canonical type checks for the aggregate type case. And add all these test cases. Richard. > > * gnat.dg/discr45.adb: New test.