From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id D883D3858D35 for ; Fri, 7 Aug 2020 23:52:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D883D3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 077Nq8kZ016121; Fri, 7 Aug 2020 18:52:08 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 077Nq7Ug016120; Fri, 7 Aug 2020 18:52:07 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 7 Aug 2020 18:52:07 -0500 From: Segher Boessenkool To: Peter Bergner Cc: GCC Patches , Bill Schmidt , Rajalakshmi Srinivasaraghavan Subject: Re: [PATCH] rs6000: MMA built-ins reject typedefs of MMA types Message-ID: <20200807235207.GC6753@gate.crashing.org> References: <33595562-7b21-d706-afdf-c6d3aebc7625@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33595562-7b21-d706-afdf-c6d3aebc7625@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2020 23:52:10 -0000 Hi! On Fri, Aug 07, 2020 at 05:16:30PM -0500, Peter Bergner wrote: > We do not allow conversions between the MMA types and other types. > However, we are being too strict in not matching MMA types with > typdefs of those types. Use TYPE_CANONICAL to see through the > types to their canonical types before comparing them. > --- a/gcc/config/rs6000/rs6000.c > +++ b/gcc/config/rs6000/rs6000.c > @@ -26803,34 +26803,48 @@ rs6000_cannot_substitute_mem_equiv_p (rtx mem) > static const char * > rs6000_invalid_conversion (const_tree fromtype, const_tree totype) > { > - if (element_mode (fromtype) != element_mode (totype)) > + /* Make sure we're working with the canonical types. */ > + if (TYPE_CANONICAL (fromtype) != NULL_TREE) > + fromtype = TYPE_CANONICAL (fromtype); > + if (TYPE_CANONICAL (totype) != NULL_TREE) > + totype = TYPE_CANONICAL (totype); > + > + machine_mode frommode = element_mode (fromtype); > + machine_mode tomode = element_mode (totype); > + > + if (frommode != tomode) > { > /* Do not allow conversions to/from PXImode and POImode types. */ > - if (TYPE_MODE (fromtype) == PXImode) > + if (frommode == PXImode) The element_mode vs. TYPE_MODE here does not matter, because we never deal with vector modes here, and they will error elsewhere anyway? Okay for trunk if that is true (or with the necessary adjustments), and okay for 10 after letting it soak for a bit. Thanks! Segher