From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25130 invoked by alias); 15 Oct 2015 08:39:21 -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 25118 invoked by uid 89); 15 Oct 2015 08:39:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f174.google.com Received: from mail-yk0-f174.google.com (HELO mail-yk0-f174.google.com) (209.85.160.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 15 Oct 2015 08:39:20 +0000 Received: by ykdt21 with SMTP id t21so11184036ykd.3 for ; Thu, 15 Oct 2015 01:39:18 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.76.151 with SMTP id z145mr5796933ywa.263.1444898358172; Thu, 15 Oct 2015 01:39:18 -0700 (PDT) Received: by 10.37.117.136 with HTTP; Thu, 15 Oct 2015 01:39:18 -0700 (PDT) In-Reply-To: <20151014162944.GE16672@kam.mff.cuni.cz> References: <20151014162944.GE16672@kam.mff.cuni.cz> Date: Thu, 15 Oct 2015 08:39:00 -0000 Message-ID: Subject: Re: Add VIEW_CONVERT_EXPR to operand_equal_p From: Richard Biener To: Jan Hubicka , Eric Botcazou Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg01443.txt.bz2 On Wed, Oct 14, 2015 at 6:29 PM, Jan Hubicka wrote: > Hi, > this patch adds VIEW_CONVERT_EXPR which is another code omitted in > operand_equal_p. During bootstrap there are about 1000 matches. > > Bootstrapped/regtested x86_64-linux, OK? Eric, does that look ok WRT TYPE_ALIGN_OK? (that is, did we decide TYPE_ALIGN_OK is no longer needed?) > Honza > > * fold-const.c (operand_equal_p): Handle VIEW_CONVERT_EXPR. > Index: fold-const.c > =================================================================== > --- fold-const.c (revision 228735) > +++ fold-const.c (working copy) > @@ -2962,6 +2968,12 @@ operand_equal_p (const_tree arg0, const_ > case IMAGPART_EXPR: > return OP_SAME (0); > > + case VIEW_CONVERT_EXPR: > + if (!(flags & (OEP_ADDRESS_OF | OEP_CONSTANT_ADDRESS_OF)) > + && !types_compatible_p (TREE_TYPE (arg0), TREE_TYPE (arg1))) Note that mixing the GIMPLE types_compatible_p into operand_equal_p which is supposed to handle GENERIC as well looks dangerous. You short-cutted the type checks for OEP_ADDRESS_OF earlier so why do you need to preserve them here? The test looks bogus anyway, but maybe it's just too early in the morning ;) Shouldn't it be && types_compatible_p (...) (instead of && !types_com...)? Otherwise it looks really weird. Richard. > + return false; > + return OP_SAME (0); > + > case TARGET_MEM_REF: > case MEM_REF: > if (!(flags & (OEP_ADDRESS_OF | OEP_CONSTANT_ADDRESS_OF)))