From patchwork Sat Jul 22 00:34:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 124162 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp544968vqg; Fri, 21 Jul 2023 17:35:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqVqw98jra6IlmhAt7UsOdJ8JOfln/hVU/WR7cf+tPAfJ72OU3BwCRjjgcCjwGPQ2/StBU X-Received: by 2002:a17:907:763c:b0:993:e752:1a6f with SMTP id jy28-20020a170907763c00b00993e7521a6fmr2645435ejc.6.1689986143406; Fri, 21 Jul 2023 17:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689986143; cv=none; d=google.com; s=arc-20160816; b=ktGXgTjsQB1bk30aUQECInOXo627fo1eV7vgu4NBv9Wkmm/97tzizkyW3MKs3HLykX MxUMaRHQL8tOrhKPBmlGbrUtrhumQZCkC/g9wKSkpk1CpNFVE9VM2kPw+z2zMzFIA2+R 1jnnFCHpCq+EKULXI8QncgdVqXJbKuVTIbImoxWng6HoCPh0nqj/Oq6BikzOnTttcxbA leny/Pnm3lLAINNdmEIOGPjlneFrvLP60amk/ec7oefZ7FzCajuRhyIhTVYuFjrBL4jk 8ZbN5y+jNRQDHPWbz/b/mfNHcDImOkQ35F9RM6Eh7zpeVJbFwCsXM4OnnUBZkQx4s6wv qXFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:content-language :subject:to:user-agent:mime-version:date:message-id:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=spcGa27u/zFLgpGolVqh/w3I3hpfhujlTR/5z3B6taY=; fh=mqA0x6dOnRFVhtRVKFz8kaHByrVFg4jlMzbx2aa/eqE=; b=gxCyT2oAco27B7QTg4sf2KNv5rQVcP3y4kzg4bAu/ivDKa26vQbeIG6ppNM83RSVCP TMel29DVBHToAKe+LUSvkteZu3kxmn5go6PqkpGxL5xnijMSWuKOUtkVQSWm6TVr/kJw peFofYQQRIOeJ0HcnQTexyn+Tr1hTxT3BGGBvjHS7ha8MS+D9Pxhjm612KdwtkOUfyqs rzMvIFTFsK+lgSFWJL42SbIm8LVfu3wKGvJfHs8nm+gtDRl8zFXjj3OWdubtSkOMQh54 b4o3kh0BNj57ebLTZD3ASy1Ql29OiU+A2cb3fYbsjnERRVWqr+dR7GrEb3cazvBeLBWr dlKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="k0iW7/iL"; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 j21-20020a170906255500b0099364d9f0e0si2799890ejb.540.2023.07.21.17.35.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 17:35:43 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b="k0iW7/iL"; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B8EC33850221 for ; Sat, 22 Jul 2023 00:35:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8EC33850221 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689986138; bh=spcGa27u/zFLgpGolVqh/w3I3hpfhujlTR/5z3B6taY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=k0iW7/iL91dfc97q++0yb1dwoOHM2WE8nZTVBVwuvqGQ+oeFKWcIgDQYgw+TkJz89 8NUK2HsbVce7ifAYLPEEa2WxkNgNVrxH6q6FZzUKuAxxxvd0UAA1A6n8x1OAv2kAMl h2D+h61oYGDWatuhOPJo7KblICbfJc8nlx1ydMpQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1B1993851171 for ; Sat, 22 Jul 2023 00:34:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B1993851171 Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-atw0rdWmPoKRcKZS8dtb2Q-1; Fri, 21 Jul 2023 20:34:47 -0400 X-MC-Unique: atw0rdWmPoKRcKZS8dtb2Q-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-3f9e556c7d8so28998091cf.0 for ; Fri, 21 Jul 2023 17:34:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689986086; x=1690590886; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Esdv4a7SL08/CyzIHRhr0C1++PhzI8aQRasFn7GK8iE=; b=LXg1o2w5yfnvYrUoA9yQsFw0Xx83ERNJVQDmR8x2yVtuP9DNBn2pndC39ZddwsECOX SxXAi2hmCWWQgJfmwN8OonSZ9YFu895gdLMuEcJ+z9OcGhnv440qkfCHbA/pJx3UpJGc TDNGUy8RtION1RuHARNYJZGl1h8ZQRMZERoZBiny7bSJ3D2vWv1AHWn5zIEGyxmDtsw/ BokIa81Gg1gxibP1Kd5E7lHaaK1df6ttuiDyffA9C2OLIPJzGX70MSL9ZNUs3U7l9E7f 2Sq/13mxr58zjtuq5AzyRmhTxpqhQhXh/wQ2OFdKwK9AdtNNOMnR7KTJu+ipNznpQ4pF uhDw== X-Gm-Message-State: ABy/qLZumirNZLyXlZXKEpb+EhlE85lf3fx3p3P5PMQVdP5oqlruzYNU dtPQWrCt6tWXOSaDl4khmaYbU4OD9RTH9TuIZ2it0jZ54p0tWa7MBBd2JI/LQIKzV0+74qAaaVI QFOzQdIrKvHsn/PfPtHMgTCSF4SXUXFdyl5WfOAZ87RTEr/eM8aD+TbYRsvOeuLOQ9+p0VtAZxy 3LsA== X-Received: by 2002:a05:622a:49:b0:403:a261:6cf1 with SMTP id y9-20020a05622a004900b00403a2616cf1mr1714639qtw.31.1689986086136; Fri, 21 Jul 2023 17:34:46 -0700 (PDT) X-Received: by 2002:a05:622a:49:b0:403:a261:6cf1 with SMTP id y9-20020a05622a004900b00403a2616cf1mr1714628qtw.31.1689986085782; Fri, 21 Jul 2023 17:34:45 -0700 (PDT) Received: from [192.168.1.88] (192-0-143-139.cpe.teksavvy.com. [192.0.143.139]) by smtp.gmail.com with ESMTPSA id t10-20020ac8738a000000b003ff1f891206sm1618963qtp.61.2023.07.21.17.34.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jul 2023 17:34:45 -0700 (PDT) Message-ID: <6b6fdcd7-95c6-3d07-397b-56bca4327cc8@redhat.com> Date: Fri, 21 Jul 2023 20:34:43 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 To: "gcc-patches@gcc.gnu.org" , Rainer Orth Subject: [pushed][LRA]: Fix sparc bootstrap after recent patch for fp elimination for avr LRA port X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, 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_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Vladimir Makarov via Gcc-patches From: Vladimir Makarov Reply-To: Vladimir Makarov Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772078910183317545 X-GMAIL-MSGID: 1772078910183317545 The following patch fixes sparc solaris bootstrap.  The explanation of the patch is in the commit message. The patch was successfully bootstrap on x86-64, aarch64, and sparc64 solaris. commit d17be8f7f36abe257a7d026dad61e5f8d14bdafc Author: Vladimir N. Makarov Date: Fri Jul 21 20:28:50 2023 -0400 [LRA]: Fix sparc bootstrap after recent patch for fp elimination for avr LRA port The recent patch for fp elimination for avr LRA port modified an assert which can be wrong for targets using hard frame pointer different from frame pointer. Also for such ports spilling pseudos assigned to fp was wrong too in the new code. Although this code is not used for any target currently using LRA except for avr. Given patch fixes the issues. gcc/ChangeLog: * lra-eliminations.cc (update_reg_eliminate): Fix the assert. (lra_update_fp2sp_elimination): Use HARD_FRAME_POINTER_REGNUM instead of FRAME_POINTER_REGNUM to spill pseudos. diff --git a/gcc/lra-eliminations.cc b/gcc/lra-eliminations.cc index cf0aa94b69a..1f4e3fec9e0 100644 --- a/gcc/lra-eliminations.cc +++ b/gcc/lra-eliminations.cc @@ -1179,8 +1179,7 @@ update_reg_eliminate (bitmap insns_with_changed_offsets) gcc_assert (ep->to_rtx != stack_pointer_rtx || (ep->from == FRAME_POINTER_REGNUM && !elimination_fp2sp_occured_p) - || (ep->from != FRAME_POINTER_REGNUM - && ep->from < FIRST_PSEUDO_REGISTER + || (ep->from < FIRST_PSEUDO_REGISTER && fixed_regs [ep->from])); /* Mark that is not eliminable anymore. */ @@ -1398,7 +1397,7 @@ lra_update_fp2sp_elimination (void) " Frame pointer can not be eliminated anymore\n"); frame_pointer_needed = true; CLEAR_HARD_REG_SET (set); - add_to_hard_reg_set (&set, Pmode, FRAME_POINTER_REGNUM); + add_to_hard_reg_set (&set, Pmode, HARD_FRAME_POINTER_REGNUM); spill_pseudos (set); for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if (ep->from == FRAME_POINTER_REGNUM && ep->to == STACK_POINTER_REGNUM)