From patchwork Fri Dec 9 13:33:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 704542 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 3tZtVw1VkDz9vDV for ; Sat, 10 Dec 2016 00:34:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Lud1r+OE"; 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:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=IAyGoQGYvRK5DmmWcReDrrtbTVFz9 j+5YK9jhTo5IHM68tV8lKIkyPFzFBS6wABP45rJRI+fBmB0gShU2ICUBJ+xah3Vl 4XP+VE8EWmckyEg0ubl7tvoKaCGfg9/z/5H/JemVzwfoOZsH2kpMZoa6a/RfRoLQ oau/5OA4iZBLzk= 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:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=W3hbLD7/lJScDbqVVxECtYNFCTM=; b=Lud 1r+OEWAGCx4XlMBGl392VTKev0Mc/bk69bAs/4YfCLsItayLobYYoxIWBhfUOyy3 F2Ahe3KxVDmI+gtwZ+la7yaVmJbBkJR0HLwWIW+lNmCMTlHtwE9FdGOL3YrmOkVN ToMQcrhPTry3Fn0MA/gh3zmn+Bafss01lgaDyDgE= Received: (qmail 112532 invoked by alias); 9 Dec 2016 13:33:39 -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 111090 invoked by uid 89); 9 Dec 2016 13:33:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1386 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Dec 2016 13:33:25 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C949707; Fri, 9 Dec 2016 05:33:24 -0800 (PST) Received: from localhost (e105548-lin.manchester.arm.com [10.45.32.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC9033F477 for ; Fri, 9 Dec 2016 05:33:23 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [56/67] Use the more specific type when two modes are known to be equal References: <87h96dp8u6.fsf@e105548-lin.cambridge.arm.com> Date: Fri, 09 Dec 2016 13:33:22 +0000 In-Reply-To: <87h96dp8u6.fsf@e105548-lin.cambridge.arm.com> (Richard Sandiford's message of "Fri, 09 Dec 2016 12:48:01 +0000") Message-ID: <87r35hfcrh.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 This patch adjusts a couple of cases in which we had established that two modes were equal and happened to be using the one with the more general type instead of the one with the more specific type. gcc/ 2016-11-24 Richard Sandiford Alan Hayward David Sherwood * expr.c (expand_expr_real_2): Use word_mode instead of innermode when the two are known to be equal. diff --git a/gcc/expr.c b/gcc/expr.c index 465326c..0d50bd0 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -8666,7 +8666,7 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode, rtx htem, hipart; op0 = expand_normal (treeop0); if (TREE_CODE (treeop1) == INTEGER_CST) - op1 = convert_modes (innermode, mode, + op1 = convert_modes (word_mode, mode, expand_normal (treeop1), TYPE_UNSIGNED (TREE_TYPE (treeop1))); else @@ -8677,8 +8677,8 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode, goto widen_mult_const; temp = expand_binop (mode, other_optab, op0, op1, target, unsignedp, OPTAB_LIB_WIDEN); - hipart = gen_highpart (innermode, temp); - htem = expand_mult_highpart_adjust (innermode, hipart, + hipart = gen_highpart (word_mode, temp); + htem = expand_mult_highpart_adjust (word_mode, hipart, op0, op1, hipart, zextend_p); if (htem != hipart)