From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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:00 -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 Content-Type: text/plain X-SW-Source: 2016-12/txt/msg00832.txt.bz2 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)