From patchwork Mon Jul 30 13:14:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 950967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-482639-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qwGYGRYx"; dkim-atps=neutral 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 41fKmH3w9Zz9ryt for ; Mon, 30 Jul 2018 23:14:37 +1000 (AEST) 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:cc:subject:date:message-id; q=dns; s=default; b=eae7tr95lesl BGP79ZAP0mj1HCsZWzt8L709N83YOW4FT89JPWCb6lOCkZrv1515IeME26fKbJ/4 gh3rrsut9pbj11lqzlvM+OxOMmOQcHIKMjr9OFliuWW7Q6IcNDbFvH9b8Mukpiv8 91lHX2u006BLbYPaKiRNkI/cltniJ84= 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:cc:subject:date:message-id; s=default; bh=kp7g1Zm5EQQJ+WaZIv 3j04YRfl0=; b=qwGYGRYxIdBljYMMrI+Jj2920Z72W1neRGQlmVIatg7CeNdW+a aH99tbwXyErAj4J9ttoaEvL1kZsYmXU+6BGV9w0qYnrHKtLTZioblY7RvLhvZLn9 9L3EN2JsP67fcHhESDRF4820KZqd9vyVFKyFY/6F0Yc8RUj95w8CuFjYU= Received: (qmail 36689 invoked by alias); 30 Jul 2018 13:14:30 -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 36669 invoked by uid 89); 30 Jul 2018 13:14:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=const_ints X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Jul 2018 13:14:28 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id AEDD3124049B; Mon, 30 Jul 2018 13:14:26 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool , tnfchris@gcc.gnu.org Subject: [PATCH] arm: Generate correct const_ints (PR86640) Date: Mon, 30 Jul 2018 13:14:23 +0000 Message-Id: <2ee02a7d9d6cbab11c23563cc9f561cdcbe8b9af.1532955615.git.segher@kernel.crashing.org> X-IsSubscribed: yes In arm_block_set_aligned_vect 8-bit constants are generated as zero- extended const_ints, not sign-extended as required. Fix that. Tamar tested the patch (see PR); no problems were found. Is this okay for trunk? Segher 2018-07-30 Segher Boessenkool PR target/86640 * config/arm/arm.c (arm_block_set_aligned_vect): Use gen_int_mode instead of GEN_INT. --- gcc/config/arm/arm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index cf12ace..f5eece4 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -30046,7 +30046,6 @@ arm_block_set_aligned_vect (rtx dstbase, rtx dst, addr, mem; rtx val_vec, reg; machine_mode mode; - unsigned HOST_WIDE_INT v = value; unsigned int offset = 0; gcc_assert ((align & 0x3) == 0); @@ -30065,10 +30064,8 @@ arm_block_set_aligned_vect (rtx dstbase, dst = copy_addr_to_reg (XEXP (dstbase, 0)); - v = sext_hwi (v, BITS_PER_WORD); - reg = gen_reg_rtx (mode); - val_vec = gen_const_vec_duplicate (mode, GEN_INT (v)); + val_vec = gen_const_vec_duplicate (mode, gen_int_mode (value, QImode)); /* Emit instruction loading the constant value. */ emit_move_insn (reg, val_vec);