From patchwork Sat Mar 2 09:18:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 209206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp389653dyc; Sat, 2 Mar 2024 01:19:21 -0800 (PST) X-Forwarded-Encrypted: i=4; AJvYcCUO+dwHXzWqSLYiBmaARd/o+lnEoj61FcURP3R6eGEeJMJGu1QOIG3XzYrLnjbqDUBeVXj0+mkAVcW3NtMuTOt3+n7l8g== X-Google-Smtp-Source: AGHT+IGfDvQpE1IqVomya/00DuhyBNdePN3Lt99THIxW7BB+ikMugHWLgLaWJ8li+Km6JuCeyN2G X-Received: by 2002:a05:620a:12d5:b0:788:1b28:b977 with SMTP id e21-20020a05620a12d500b007881b28b977mr1008678qkl.39.1709371160788; Sat, 02 Mar 2024 01:19:20 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1709371160; cv=pass; d=google.com; s=arc-20160816; b=gxZHig4Kuzqs7AzUW+UazjUwUbFGwmIqG2QLG/Py9wv/CmWYgQe0mpl/h5CSy4+n6q Pg613NnkpejGTNKW6081b8r8SWdwjDh+aS+kXunXzVpzFTxO0iQ75GHs/YlVw63DaElV 8yYQohz/eQH96DvRzDbOOLlW9Fh5KehSKB8O/5WHqVynS0eIZO3+V0vYXOE89dsF7/CH F4unGxDOPlnr838/tOQ3Jq6Ao08soW/g4g+RIW80s5Y2bTI5APdUsKEoWskAsrI0m6B9 Z8g/I2vF32hh95XUt+9w4l3fALbrUf2UTY/u9WCAw0LfCyjqPjt6FUjOH1QJYhz3rnxb mw3A== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :subject:to:from:content-language:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=7wOnTL8OHO8Br1BE1u+uWY6GRiBqZbMx8umuLppY8fo=; fh=XNn3asQvIblazGK92GBt13dVv+YmGV3pBS0JC29ZQco=; b=wB5NRzi5+F5dfSRhWAxeESb0D//jrOrsKmudnjkgwernkofpFYdpnCybRnodYhY0uS juuN5MoTkHNeFjJ/TK8aZOR2fLYiUq6udYGFKd8vrn2LOlfyaERlTJAPAez12ConyAZv MnBnoQhPdxM85jjNbb7/SiR3HQH4DFcrQ16N3ig3FmrrG0Cq9imywBxwUdVW9DFIpBVi m21ktOjAa9uZBE5xBYeIa+2OIdCW30JLxsWX9+cgN5Mk1hjWAsX8eQpo322v2WIhUPg/ zOHQ9mbQpIeKV+uG0rAE+JRDr9slX/Pub9kQpe72RCLdUboUdprZ9MGGz8OKo1Q3j58d 7gqg==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@gjlay.de header.s=strato-dkim-0002 header.b=JrAORTpe; dkim=neutral (no key) header.i=@gjlay.de header.s=strato-dkim-0003; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id wl21-20020a05620a57d500b00787c5a36a7bsi5407535qkn.611.2024.03.02.01.19.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 01:19:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gjlay.de header.s=strato-dkim-0002 header.b=JrAORTpe; dkim=neutral (no key) header.i=@gjlay.de header.s=strato-dkim-0003; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C96A3858C66 for ; Sat, 2 Mar 2024 09:19:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.217]) by sourceware.org (Postfix) with ESMTPS id 5E8943858D3C for ; Sat, 2 Mar 2024 09:18:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E8943858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gjlay.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=gjlay.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5E8943858D3C Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=81.169.146.217 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709371116; cv=pass; b=kBGvyDMKeMJk9co9XjVgttRra90kG45IMyoMwpC3McyCLBv1uu9qyi5sJR1R5zHcX0+caYnda/w4ZYJDiM5KSk0SI1vc3jemwszucUEG/FvM8EA2GfmUPoyBhDnVTa/QaiqSmJRE9czgAcWON/CL1ofCIahST6F5RMedAqkONnw= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709371116; c=relaxed/simple; bh=tdkxCNSe0WlwdNv5c2aI21MF3FnbLeZ0ysXcwJcSlww=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version:From: To:Subject; b=ptl1yCshcUYVfcHJA+rn23gTkXC4DcdEKZvlEj2aPSR2vtz/Ds/IKvKquPgbKntzsvFvFflq4rcMGsa1oMOPMyYOGIxqvrcL3692ixkz4vt/kY/Y/WOBTvU/6PvwLHDwYMiMaA6Rn/dzimxm32kPUze9IIpG1WeK4e44Qv+ymmo= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1709371113; cv=none; d=strato.com; s=strato-dkim-0002; b=Udc5iEAxQBdI9wTFAfnhOzgj1sDmmk0fQ4EA5Q6GqhuLTclxmzOZRJXkMOGC4a5eCH 2PsDnFC9tfy7ivSJF8J6nx0ApkZ9BrtDcxVzw7TtzKCrwkZeS7FymEaQRPKfMuKbLoA7 lq5xnbbxsn/HwV9Nk4VBQ/A6KHxS158LgqX2klsrmFKXioJS3H0STiLEke9zEQ19rUGa zOBWLkHZYMKzyGdQHAzq37uq71rrnA48QIbZ4+aBUZPWo/o2GqpOPTj6M0/EzQo5qFkS r51S2Gfz+M4LGXjUVZypFJ3lMOA5xhWn/39JCGKTsnUnaEQHji9zsRe5TfbtVnZrdpBN Z+Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1709371113; s=strato-dkim-0002; d=strato.com; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=7wOnTL8OHO8Br1BE1u+uWY6GRiBqZbMx8umuLppY8fo=; b=f2uCUoyO8pJDj3PkAQfw8542ASQhlfirZReTj5837xeg/xTzJuo7rC0vl2hyWak3yu TjxVdnUcK64psqfz138f24iVSNrvY5jVSF4ytkZxwbW0DW7T2G8lxOJ9tBDH8GYfAdOs iX0++RsH81VpqnzbQGRKTIdBWCYyUN/ois9JBvWQT8sU4V+FCJ6t3ri7erdQnhn1jAB2 9Tip8JA6s8Teygd5AgyIG2IbzEw5jmyKcdswPH7hFXZd9jjRMHWSvc7TVOULHvJhHXiY UzEUGnU0CGkX7T/3quZVx3K9DZmcuPFNm5WyHb9nuEEqgDOITIBqtXGh3bQ7nh86e9pF 5QZQ== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1709371113; s=strato-dkim-0002; d=gjlay.de; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=7wOnTL8OHO8Br1BE1u+uWY6GRiBqZbMx8umuLppY8fo=; b=JrAORTpe5R4QkdBtMY/Ol/KBZC+tO0k71SKpTQ2iv08hnwDVPXIB+b9gSCMs+Q9OOn 5CKHTjHNK0vFcP18TK8EjU0jX3r86a7zuw1MdAESPh31HjCPlW7+6Jbt/bSJLFUACUgG pD39Zs2w02sG+OAwo3A47EhlcCZJBkuJD5crO4INtsNcYP43fiv317x4ECh10i6G/OVl koC5qY4nljTiGud+b/965JIlV/3YanemRcHz5uqh6FbOBGfnsdnTtYan1AEUI3l3cp7R /qvVHQSq0FUgA+yDQsssWwcuzCcOh4/S+DN0UEG3g9XUOsVtNWTvGarTa54dXSG2QUFG vaMQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1709371113; s=strato-dkim-0003; d=gjlay.de; h=Subject:To:From:Date:Message-ID:Cc:Date:From:Subject:Sender; bh=7wOnTL8OHO8Br1BE1u+uWY6GRiBqZbMx8umuLppY8fo=; b=kkZyR4mam4uA1Yyn/9M+g8Nxvm+iMiorxhmfzixWAuoHmioFsiRwoL6DCcF6IjtQ9G PMhqvQqiqPlofuL9xkDQ== X-RZG-AUTH: ":LXoWVUeid/7A29J/hMvvT3koxZnKT7Qq0xotTetVnKkSgcSjpmy9KwoMJ/K0VA==" Received: from [192.168.2.102] by smtp.strato.de (RZmta 50.2.0 DYNA|AUTH) with ESMTPSA id Jdfd100229IW2am (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Sat, 2 Mar 2024 10:18:32 +0100 (CET) Message-ID: <4aabc854-dacc-4c24-adae-96e03d850713@gjlay.de> Date: Sat, 2 Mar 2024 10:18:29 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Georg-Johann Lay To: "gcc-patches@gcc.gnu.org" Subject: [patch,avr,applied] Take into account -mtiny-stack in frame pointer adjustments X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792405574311216927 X-GMAIL-MSGID: 1792405574311216927 Applied this addendum to avr PR114100: When the frame pointer is adjusted and -mtiny-stack is set, then it is enough to adjust the low part of the frame pointer. Johann --- AVR: target/114100 - Factor in -mtiny-stack in frame pointer adjustments gcc/ PR target/114100 * config/avr/avr.cc (avr_out_plus_1) [-mtiny-stack]: Only adjust the low part of the frame pointer with 8-bit stack pointer. diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc index 94ef7c591a9..d39d6707c97 100644 --- a/gcc/config/avr/avr.cc +++ b/gcc/config/avr/avr.cc @@ -8983,14 +8983,17 @@ avr_out_plus_1 (rtx *xop, int *plen, enum rtx_code code, int *pcc, && frame_pointer_needed && REGNO (xop[0]) == FRAME_POINTER_REGNUM) { - rtx xval16 = simplify_gen_subreg (HImode, xval, imode, i); - if (xval16 == const1_rtx || xval16 == constm1_rtx) + if (AVR_HAVE_8BIT_SP) + { + avr_asm_len ("subi %A0,%n2", xop, plen, 1); + return; + } + else if (xop[2] == const1_rtx || xop[2] == constm1_rtx) { - avr_asm_len ((code == PLUS) == (xval16 == const1_rtx) + avr_asm_len (xop[2] == const1_rtx ? "ld __tmp_reg__,%a0+" : "ld __tmp_reg__,-%a0", xop, plen, 1); - i++; - continue; + return; } }