From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonicconh6001-vm0.mail.ssk.yahoo.co.jp (sonicconh6001-vm0.mail.ssk.yahoo.co.jp [182.22.37.9]) by sourceware.org (Postfix) with ESMTPS id 75F143858000 for ; Fri, 21 Oct 2022 02:58:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 75F143858000 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=yahoo.co.jp Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.co.jp X-YMail-OSG: rsvrSWQVM1m.mocd.6MYg3Fk4.Q31xgFubv0KUa0OikbzeGS4vljYs8lgaqUI4W TOn1lVbYe8DsuUbRFs8E1J_91w6d6Iw52K6Bj_Xfg8q3XcmEr7Qqq8kkFve9bgOrFDWq.Rkk9IM_ u_8K.3biF8yIL36TRmmyEtLEHnoUQssrf3VDu5e57w8MdiQhaiNBnOJkWdxV8yFeMzb0T6ElGcj7 P_wxUnRKGfQ1pidERbiLjvnUSX0lFOQp.12LXp6k.j6uxTW8HQimbEt2qHfEgzj4BYInCavIPgl3 SdHz0NpoeHqB0T.pLHiQ3z_IdE17kKJklfVydL6oDf3NCurfsrPEh5fhcylbCtaG18dqAR86mWTO AO7r_VrW2lTCPdXVCeEB8Q4ZRd79TATDVVFvRSuu.9Q5dlfJDliIrm0uvR9.Lxj.t.9HHAa6kKPC .xndO5iOieF07xzrVun8D3for61P9.jnnv1Km7E5.OMR_4H5MoYVF3bJs11C45DWi.vWbl3BD9N2 MIdld7vfwW9w8q7W3eG3del3XtAteQUwhSXxCZ5ZVqVUBZo2jl03QGdVWReZI0R3jtRsTAELnDbo 5SKyFucxhjptW0ng2Z8ssCjlhzJCoqwYezJPWe5gmnfoH_gjRGxRUtSa29Em4CbmDCsvXt7nbkIK CyzZKpJM5ZjQcQThKoRaamvhYhyMnCl9eUAjFotuBvkM0gLErHrRN4qHt05P2JBtkpRgx7jqBDgg lB2TFajzbL_13DFglAiZdh7AFd7BJEEEAjuegvo37NvgrUnjjJX0_f_NTsrWVFI6PAqAtxVoaxEW laJbL8d14RosftU7afpqCesb8MxyXkqIFHj4q70l93C2t5UDN3MI5YJ0W35UNukVPUeQ9WK39lDy y1MtHNb3lAJkpYVjNm2LKO_zhL6cirmJb3mLUsUDY6smldk49IMqRh4Q7UX_xtkmtpJ3L_MuABBS .douD5g8- Received: from sonicgw.mail.yahoo.co.jp by sonicconh6001.mail.ssk.yahoo.co.jp with HTTP; Fri, 21 Oct 2022 02:58:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1666321119; s=yj20110701; d=yahoo.co.jp; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:Content-Type:Content-Transfer-Encoding:References; bh=Vk2/szhluPSKfnj8DUGVhmRGaU81mzli7h+8b53PYmE=; b=RStoS/fN60b9JnZVuFMCyPQwPI5Ng1z3ZSQoQolPB8Y+qbwCFXxsR7tCDpsYEAML R7Sh0GcRwg0JNVaGNiPRE/+tgc4tp3+o04B5LO/o+66D//GCOQwKKLkj9BudexOsShq 1H/8JmKut3Uz4s9xZ4kWBOSkPCifkB1elsiQWXPc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=yj20110701; d=yahoo.co.jp; h=Message-ID:Date:MIME-Version:From:Cc:Content-Type:Content-Transfer-Encoding:References; b=Ax139ZeSrNXsApWSspvcrHcQsQg+P+WLthbPPM6N5JKu9CDJyR0A02xhrvWVPSbY n9e54YCVWEc8F3oXSye3FByngjohfjybHQfwHvk+OHtUFItL62bZIaXAR/15YYpFuM7 UUhZMzu1oV1mfApGxUrMlK+SbveGTTvIzDi+UuDE=; Received: by smtphe6005.mail.ssk.ynwp.yahoo.co.jp (YJ Hermes SMTP Server) with ESMTPA ID beda8a94db2096bc6f0cd73c13813b22; Fri, 21 Oct 2022 11:58:38 +0900 (JST) Message-ID: Date: Fri, 21 Oct 2022 11:58:35 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 From: Takayuki 'January June' Suwa Subject: [PATCH] xtensa: Make register A0 allocable for the CALL0 ABI To: GCC Patches Cc: Max Filippov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit References: X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,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: This patch offers an additional allocable register by RA for the CALL0 ABI. > Register a0 holds the return address upon entry to a function, but > unlike the windowed register ABI, it is not reserved for this purpose > and may hold other values after the return address has been saved. - Xtensa ISA Reference Manual, 8.1.2 "CALL0 Register Usage and Stack Layout" [p.589] gcc/ChangeLog: * config/xtensa/xtensa.cc (xtensa_conditional_register_usage): Remove register A0 from FIXED_REGS if the CALL0 ABI. --- gcc/config/xtensa/xtensa.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index 950eb5a59be..f30725113dc 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -4970,6 +4970,13 @@ xtensa_conditional_register_usage (void) /* Remove hard FP register from the preferred reload registers set. */ CLEAR_HARD_REG_BIT (reg_class_contents[(int)RL_REGS], HARD_FRAME_POINTER_REGNUM); + + /* Register A0 holds the return address upon entry to a function + for the CALL0 ABI, but unlike the windowed register ABI, it is + not reserved for this purpose and may hold other values after + the return address has been saved. */ + if (!TARGET_WINDOWED_ABI) + fixed_regs[A0_REG] = 0; } /* Map hard register number to register class */ -- 2.30.2