From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x636.google.com with SMTP id ky4so7798480plb.3 for ; Tue, 21 Feb 2023 13:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6tevDas5iDppuQRlIJ/3TFIVa7hU028c0IrZtSfvsUY=; b=kmDdhVgjalOp2WrWOHuL2/9NPOF5dEAWaNaK7SEpazmbklc09KpiDIwi2BgqLD3oRb 8bD5UbM9c+jEvG7ZaeVQXRwMskBmtwpW873shehNQV7am19frebnxxxjOU6Gphkr6QjZ X3eJUq7n4xG9UEOBnyKAk6HUEOOJhcz4reZ65m6R9C9Qx0Xds4g2obd0UlxdjmeYR2zC 46F6z7nD43lCC7RoQxF9hz3rl4I7wgpDBYHkR3EkiavoQKUX/ZEjsKY7jhGqAQo+9hBz 8tsFa2EzMG2Q3pZl1csr5/LJebWUzONmexAl5gK3B5wcgZ4GdwsbxzjyLkZG76Chc3LU l8sg== 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) From: Max Filippov 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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); -- 2.30.2