From patchwork Mon Oct 19 19:41:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 532531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 59F201402C4 for ; Tue, 20 Oct 2015 06:41:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=OQSR3la4; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=fiQbAc4qoxZvIBO3U Ioh26d55sMsmOugRYZQynN3s1WCS2OOOt+ernn/Z1CqE79ol114SLmExVC126v2F NDrk6gJlJB3GUuR3LnzjneM1S1I/Lb8bPPLP6Se6AiQU6UVgvwwc95CpwgIzkv/n ARQ3G6bPx8wMesaHxWpzYqLneE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=87eOSkJP1eEiUOHS0POJQ4c I/KA=; b=OQSR3la41FMVFsn2/q/Z2Ns2Ca0XQUUcTi5WW9332E55L8jJxluTW2r 3DRQfpSr2Agg18IWdKwvx4edCxkZCEUJHh/99qRRK/ooMP/xoRyqQcGn0Do9Jo9w AKySPjzHvz9sFH/SmS7TaGaICYXgT/wOv561QN1Q9S8OdIYNOoXc= Received: (qmail 71699 invoked by alias); 19 Oct 2015 19:41:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 71689 invoked by uid 89); 19 Oct 2015 19:41:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 19 Oct 2015 19:41:07 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 311C5540B9A; Mon, 19 Oct 2015 21:41:03 +0200 (CEST) Date: Mon, 19 Oct 2015 21:41:03 +0200 From: Jan Hubicka To: Eric Botcazou Cc: Jan Hubicka , gcc-patches@gcc.gnu.org, Richard Biener Subject: Re: Add VIEW_CONVERT_EXPR to operand_equal_p Message-ID: <20151019194102.GA48581@kam.mff.cuni.cz> References: <20151014162944.GE16672@kam.mff.cuni.cz> <1833908.my5suBVC6X@polaris> <20151018160651.GA63497@kam.mff.cuni.cz> <21255721.Or0yReY6Nx@polaris> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <21255721.Or0yReY6Nx@polaris> User-Agent: Mutt/1.5.21 (2010-09-15) Hi, this is patch that reverts the TYPE_MODE mismatch related changes and adds test to type checker that TYPE_MODE always match with TYPE_CANONICAL. I have bootstrapped/regtested x86_64-linux, but unfrtunately the regtesting had some unrelated noise (spawn failures). I am re-testing. I am on a trip and will likely only access interenet again from Des Moines tonight. Honza * 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 complete 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) @@ -88,9 +88,10 @@ useless_type_conversion_p (tree outer_ty return true; /* Changes in machine mode are never useless conversions unless we - deal with aggregate types in which case we defer to later checks. */ + deal with complete aggregate types in which case we defer to later + checks. */ if (TYPE_MODE (inner_type) != TYPE_MODE (outer_type) - && !AGGREGATE_TYPE_P (inner_type)) + && (!AGGREGATE_TYPE_P (inner_type) || COMPLETE_TYPE_P (outer_type))) return false; /* If both the inner and outer types are integral types, then the