From patchwork Tue Sep 7 22:56:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1525577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=IlyKlw35; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H40yT24M6z9s5R for ; Wed, 8 Sep 2021 08:57:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8FE263851C21 for ; Tue, 7 Sep 2021 22:57:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FE263851C21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1631055420; bh=e3WfaCL3FS4pSYbvlWCpoJft7VL4Fq66tocMCF3OeqQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=IlyKlw35Dy5QkVQh2rOk/NiUz4cJ9wXpEAbp9PRnPLZYYL4XkG7y1SC6kSg7Magen xf4dxQ8O5oo/CbnG7erTDXsdtBl3Lnkq+UlHiyG7bzxAUtYWa1q6pZg2+X5d6T2Y5d drI1676J5FTPp58EQI8PLXGabT6VNL9ZAivII4d8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 108DD3858023 for ; Tue, 7 Sep 2021 22:56:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 108DD3858023 Received: by mail-pf1-x42e.google.com with SMTP id m26so382754pff.3 for ; Tue, 07 Sep 2021 15:56:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=e3WfaCL3FS4pSYbvlWCpoJft7VL4Fq66tocMCF3OeqQ=; b=NZZpb4BE8bQrkjHkVuCpTtfcoqDbV4FAQensivoeOO+CdIASZ0kKpjwpKyNPsfrw8Y S26AVuQB15D8wilzGHlD7KrncRVipNZmnErrtp+gXezHYsgm5YD0d/ANS+OLAU23wMAW 5b5Y8KLO7eWlqdvQcD5u1XdRwTt6VSoaxTqwzcc1RnWETSVvIrmBqNB3VVhXd082l2Uk 68YcexrOCDBI57D//SMw3cxgYMlNwsSCrFZ/1KYhvv9ioR4O9wo6EuEU27OjzZWYd7kD PaQNkm3E6/9FV4onbKb2p+Ory8orSDsqJmiquB1Ux4gUSrIKzuzL0UBv8K8h07YNAMmh PFwA== X-Gm-Message-State: AOAM532yOI2ZZ/bJtLEuDnbd/YkwZ2AWp2tWXtFeO0LL8jKegg2IXGCV Kwx1RURKEFkxGgtBxT5TffK1iGeoRSo= X-Google-Smtp-Source: ABdhPJzb9l160fmBTypoUMaQwID81myib1MLDuFk9To8EyOA9NCZZY3HJfE71HtM8gzhokChzPuUTw== X-Received: by 2002:a62:c585:0:b0:416:2c4b:cc3f with SMTP id j127-20020a62c585000000b004162c4bcc3fmr688523pfg.55.1631055399820; Tue, 07 Sep 2021 15:56:39 -0700 (PDT) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:49eb:5986:4393:7ed3]) by smtp.gmail.com with ESMTPSA id u24sm130427pfm.85.2021.09.07.15.56.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 15:56:39 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [COMMITTED] gcc: xtensa: fix PR target/102115 Date: Tue, 7 Sep 2021 15:56:21 -0700 Message-Id: <20210907225621.28091-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, GIT_PATCH_0, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Max Filippov via Gcc-patches From: Max Filippov Reply-To: Max Filippov Cc: linux-xtensa@linux-xtensa.org Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 2021-09-07 Takayuki 'January June' Suwa gcc/ PR target/102115 * config/xtensa/xtensa.c (xtensa_emit_move_sequence): Add 'CONST_INT_P (src)' to the condition of the block that tries to eliminate literal when loading integer contant. --- gcc/config/xtensa/xtensa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index f4f8f1975c55..8d6755144c12 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1084,7 +1084,8 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode) { /* Try to emit MOVI + SLLI sequence, that is smaller than L32R + literal. */ - if (optimize_size && mode == SImode && register_operand (dst, mode)) + if (optimize_size && mode == SImode && CONST_INT_P (src) + && register_operand (dst, mode)) { HOST_WIDE_INT srcval = INTVAL (src); int shift = ctz_hwi (srcval);