From patchwork Tue Feb 21 21:56:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1745957 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.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=Mzwnoc0s; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PLtRW5QZJz23j7 for ; Wed, 22 Feb 2023 08:56:53 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6AD553858C39 for ; Tue, 21 Feb 2023 21:56:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AD553858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677016611; bh=6tevDas5iDppuQRlIJ/3TFIVa7hU028c0IrZtSfvsUY=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Mzwnoc0sc1lEV0FJa7O6eUmsXNxarErq3iFrlpEz8OuQ5V/97TJ+U0OF+0+xdx4d9 qCgYS3ivJAYaSU1g1B/v5qRCM8MW4kopxTeQ245jETvmxGvl+Z4oEhJLvvrsEyEXjQ mJ8OzmQdj9HqvFBr4XpJLZQIJWhY4V6vvrpfm07o= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 02CFE3858D37 for ; Tue, 21 Feb 2023 21:56:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02CFE3858D37 Received: by mail-pl1-x636.google.com with SMTP id ky4so7798480plb.3 for ; Tue, 21 Feb 2023 13:56:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6tevDas5iDppuQRlIJ/3TFIVa7hU028c0IrZtSfvsUY=; b=NlLDHSaGCiri+4j1bnVrCMOOqY6gHIy4zU+4B9mVXn4BY3G1VVWf7HH1PSeuHJtlzj tKIHSPErIro7uytuWzzowHSGH94L4Ni9cCWQTWrWq5USDgqStCNDKzUMI9/cqAFRRhpL HDpVc3dhXwOghabS6abtPdS018hpDHyAMBYF4l/2ZQiuD1fNphvLElHjMsouP+Twxh7U UYB115gnmSg4VXZj13qPunqjPI/JmhSXCiy3lF55BQwqO7hkvvO3FdEFf8mpDdsSTtML P8i2TtCpdgMi82JLvCQzZR9oyOsDjFpGGtyeI0AOA9zF3Z1qRIgsCp+KsTd2ZMJoBlgM LIQQ== X-Gm-Message-State: AO0yUKXzHukSuuSclUGb8IuOWjuNSJU2jr+yEhr8CB/RgBpExhUK1yXZ o5mezc0Dmk2pQVmtCK6YFrMpunbpqgc= X-Google-Smtp-Source: AK7set+y2qo6q0kg5z9CfJ7Yk0UjVcDAqI6abheWmdRPHtmgoEMKy8ZqzXsb1g/g9GmvvjHj8fjMnQ== X-Received: by 2002:a17:90b:38c1:b0:230:a1ce:f673 with SMTP id nn1-20020a17090b38c100b00230a1cef673mr5515381pjb.4.1677016590398; Tue, 21 Feb 2023 13:56:30 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net ([2601:641:401:1d20:3050:896c:89c8:f023]) by smtp.gmail.com with ESMTPSA id x7-20020a17090a294700b00234899c65e7sm3706950pjf.28.2023.02.21.13.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 13:56:29 -0800 (PST) To: gcc-patches@gcc.gnu.org Cc: Takayuki 'January June' Suwa , Max Filippov Subject: [COMMITTED] gcc: xtensa: fix PR target/108876 Date: Tue, 21 Feb 2023 13:56:22 -0800 Message-Id: <20230221215622.3077474-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Spam-Status: No, score=-8.6 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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 Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" gcc/ PR target/108876 * config/xtensa/xtensa.cc (xtensa_expand_epilogue): Drop emit_use for A0_REG. * config/xtensa/xtensa.md (sibcall, sibcall_internal) (sibcall_value, sibcall_value_internal): Add 'use' expression for A0_REG. --- gcc/config/xtensa/xtensa.cc | 2 -- gcc/config/xtensa/xtensa.md | 20 +++++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index d0320efe21d4..5c1c713e122d 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -3548,8 +3548,6 @@ xtensa_expand_epilogue (bool sibcall_p) gen_frame_mem (SImode, x)); } } - if (sibcall_p) - emit_use (gen_rtx_REG (SImode, A0_REG)); if (cfun->machine->current_frame_size > 0) { diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index d3996b26cb5c..b8a8aaf97640 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -2369,8 +2369,10 @@ (set_attr "length" "3")]) (define_expand "sibcall" - [(call (match_operand 0 "memory_operand" "") - (match_operand 1 "" ""))] + [(parallel [ + (call (match_operand 0 "memory_operand" "") + (match_operand 1 "" "")) + (use (reg:SI A0_REG))])] "!TARGET_WINDOWED_ABI" { xtensa_prepare_expand_call (0, operands); @@ -2378,7 +2380,8 @@ (define_insn "sibcall_internal" [(call (mem:SI (match_operand:SI 0 "call_insn_operand" "nic")) - (match_operand 1 "" "i"))] + (match_operand 1 "" "i")) + (use (reg:SI A0_REG))] "!TARGET_WINDOWED_ABI && SIBLING_CALL_P (insn)" { return xtensa_emit_sibcall (0, operands); @@ -2388,9 +2391,11 @@ (set_attr "length" "3")]) (define_expand "sibcall_value" - [(set (match_operand 0 "register_operand" "") - (call (match_operand 1 "memory_operand" "") - (match_operand 2 "" "")))] + [(parallel [ + (set (match_operand 0 "register_operand" "") + (call (match_operand 1 "memory_operand" "") + (match_operand 2 "" ""))) + (use (reg:SI A0_REG))])] "!TARGET_WINDOWED_ABI" { xtensa_prepare_expand_call (1, operands); @@ -2399,7 +2404,8 @@ (define_insn "sibcall_value_internal" [(set (match_operand 0 "register_operand" "=a") (call (mem:SI (match_operand:SI 1 "call_insn_operand" "nic")) - (match_operand 2 "" "i")))] + (match_operand 2 "" "i"))) + (use (reg:SI A0_REG))] "!TARGET_WINDOWED_ABI && SIBLING_CALL_P (insn)" { return xtensa_emit_sibcall (1, operands);