From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57860 invoked by alias); 3 Nov 2015 10:26: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 57849 invoked by uid 89); 3 Nov 2015 10:26:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 03 Nov 2015 10:26:10 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6F4D3289CFC3; Tue, 3 Nov 2015 11:26:07 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ACzp8zr23V87; Tue, 3 Nov 2015 11:26:07 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 4CEFC289CF35; Tue, 3 Nov 2015 11:26:07 +0100 (CET) From: Eric Botcazou To: Richard Biener Cc: gcc-patches@gcc.gnu.org, Jan Hubicka Subject: Re: Add VIEW_CONVERT_EXPR to operand_equal_p Date: Tue, 03 Nov 2015 10:26:00 -0000 Message-ID: <9581963.UiT3dqoIih@polaris> User-Agent: KMail/4.14.9 (Linux/3.16.7-29-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: <2A191FEA-C08A-4BEF-8AB5-420487E703CC@gmail.com> References: <20151014162944.GE16672@kam.mff.cuni.cz> <1693727.sAndYEapaL@polaris> <2A191FEA-C08A-4BEF-8AB5-420487E703CC@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart3788956.HqSkmoRpHM" Content-Transfer-Encoding: 7Bit X-SW-Source: 2015-11/txt/msg00173.txt.bz2 This is a multi-part message in MIME format. --nextPart3788956.HqSkmoRpHM Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 497 > I suggest to re-instantiate the canonical type checks for the aggregate type > case. OK, thanks, this fixes all the known ICEs so far. Tested on x86_64-suse-linux, OK for the mainline? 2015-11-03 Eric Botcazou * gimple-expr.c (useless_type_conversion_p): Reinstate type canonical check for aggregate types and beef up comment for mode check. 2015-11-03 Eric Botcazou * gnat.dg/discr45.adb: Only compile the test. -- Eric Botcazou --nextPart3788956.HqSkmoRpHM Content-Disposition: attachment; filename="p.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="utf-8"; name="p.diff" Content-length: 1194 Index: gimple-expr.c =================================================================== --- gimple-expr.c (revision 229616) +++ gimple-expr.c (working copy) @@ -84,7 +84,15 @@ useless_type_conversion_p (tree outer_ty if (inner_type == outer_type) return true; - /* Changes in machine mode are never useless conversions unless. */ + /* For aggregate types, if we know the canonical types, compare them. This + is important for the remapping of variably-modified types. */ + if (AGGREGATE_TYPE_P (inner_type) + && TYPE_CANONICAL (inner_type) + && TYPE_CANONICAL (inner_type) == TYPE_CANONICAL (outer_type)) + return true; + + /* Changes in machine mode are never useless conversions because the RTL + middle-end expects explicit conversions between modes. */ if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type)) return false; Index: testsuite/gnat.dg/discr45.adb =================================================================== --- testsuite/gnat.dg/discr45.adb (revision 229630) +++ testsuite/gnat.dg/discr45.adb (working copy) @@ -1,4 +1,4 @@ --- { dg-do run } +-- { dg-do compile } -- { dg-options "-O2 -gnatws" } procedure Discr45 is --nextPart3788956.HqSkmoRpHM--