From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25473 invoked by alias); 21 Oct 2015 08:50:59 -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 25462 invoked by uid 89); 21 Oct 2015 08:50:58 -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,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no 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; Wed, 21 Oct 2015 08:50:57 +0000 Received: by ykdr3 with SMTP id r3so42308189ykd.1 for ; Wed, 21 Oct 2015 01:50:55 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.125.194 with SMTP id y185mr5547720ywc.5.1445417455363; Wed, 21 Oct 2015 01:50:55 -0700 (PDT) Received: by 10.37.117.136 with HTTP; Wed, 21 Oct 2015 01:50:55 -0700 (PDT) In-Reply-To: <20151021040515.GA90615@kam.mff.cuni.cz> References: <20151014162944.GE16672@kam.mff.cuni.cz> <1833908.my5suBVC6X@polaris> <20151018160651.GA63497@kam.mff.cuni.cz> <21255721.Or0yReY6Nx@polaris> <20151019194102.GA48581@kam.mff.cuni.cz> <20151021040515.GA90615@kam.mff.cuni.cz> Date: Wed, 21 Oct 2015 08:54:00 -0000 Message-ID: Subject: Re: Add VIEW_CONVERT_EXPR to operand_equal_p From: Richard Biener To: Jan Hubicka Cc: Eric Botcazou , GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg02032.txt.bz2 On Wed, Oct 21, 2015 at 6:05 AM, Jan Hubicka wrote: > Hi, > here is updated patch that applies changes suggested by Richard. I apologize > for the delay - the testing failed several times on gcc10.fsffrance.org for me > for out-of-memory errors (which are unrelated) and I was on the travel. > > Bootstrapped/regtested x86_64-linux, OK? Ok. Thanks, Richard. > * tree.c (verify_type): Verify that TYPE_MODE match > between TYPE_CANONICAL and type. > * expr.c (store_expr_with_bounds): Revert my previous change. > * expmed.c (store_bit_field_1): Revert prevoius change. > * gimple-expr.c (useless_type_conversion_p): Require TYPE_MODE > to match for all types. > > Index: tree.c > =================================================================== > --- tree.c (revision 228933) > +++ tree.c (working copy) > @@ -13344,6 +13344,14 @@ verify_type (const_tree t) > error_found = true; > } > > + if (COMPLETE_TYPE_P (t) && TYPE_CANONICAL (t) > + && TYPE_MODE (t) != TYPE_MODE (TYPE_CANONICAL (t))) > + { > + error ("TYPE_MODE of TYPE_CANONICAL is not compatible"); > + debug_tree (ct); > + error_found = true; > + } > + > > /* Check various uses of TYPE_MINVAL. */ > if (RECORD_OR_UNION_TYPE_P (t)) > Index: expr.c > =================================================================== > --- expr.c (revision 228933) > +++ expr.c (working copy) > @@ -5425,14 +5425,6 @@ store_expr_with_bounds (tree exp, rtx ta > temp = convert_modes (GET_MODE (target), TYPE_MODE (TREE_TYPE (exp)), > temp, TYPE_UNSIGNED (TREE_TYPE (exp))); > > - /* We allow move between structures of same size but different mode. > - If source is in memory and the mode differs, simply change the memory. */ > - if (GET_MODE (temp) == BLKmode && GET_MODE (target) != BLKmode) > - { > - gcc_assert (MEM_P (temp)); > - temp = adjust_address_nv (temp, GET_MODE (target), 0); > - } > - > /* If value was not generated in the target, store it there. > Convert the value to TARGET's type first if necessary and emit the > pending incrementations that have been queued when expanding EXP. > Index: expmed.c > =================================================================== > --- expmed.c (revision 228933) > +++ expmed.c (working copy) > @@ -757,14 +757,6 @@ store_bit_field_1 (rtx str_rtx, unsigned > } > } > > - /* We allow move between structures of same size but different mode. > - If source is in memory and the mode differs, simply change the memory. */ > - if (GET_MODE (value) == BLKmode && GET_MODE (op0) != BLKmode) > - { > - gcc_assert (MEM_P (value)); > - value = adjust_address_nv (value, GET_MODE (op0), 0); > - } > - > /* Storing an lsb-aligned field in a register > can be done with a movstrict instruction. */ > > Index: gimple-expr.c > =================================================================== > --- gimple-expr.c (revision 228933) > +++ gimple-expr.c (working copy) > @@ -87,10 +87,8 @@ useless_type_conversion_p (tree outer_ty > if (inner_type == outer_type) > return true; > > - /* Changes in machine mode are never useless conversions unless we > - deal with aggregate types in which case we defer to later checks. */ > - if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type) > - && !AGGREGATE_TYPE_P (inner_type)) > + /* Changes in machine mode are never useless conversions unless. */ > + if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type)) > return false; > > /* If both the inner and outer types are integral types, then the > @@ -270,10 +268,9 @@ useless_type_conversion_p (tree outer_ty > use the types in move operations. */ > else if (AGGREGATE_TYPE_P (inner_type) > && TREE_CODE (inner_type) == TREE_CODE (outer_type)) > - return (!TYPE_SIZE (outer_type) > - || (TYPE_SIZE (inner_type) > - && operand_equal_p (TYPE_SIZE (inner_type), > - TYPE_SIZE (outer_type), 0))); > + return (TYPE_MODE (outer_type) != BLKmode > + || operand_equal_p (TYPE_SIZE (inner_type), > + TYPE_SIZE (outer_type), 0)); > > else if (TREE_CODE (inner_type) == OFFSET_TYPE > && TREE_CODE (outer_type) == OFFSET_TYPE)