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: 1811176 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=8.43.85.97; helo=server2.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=K/eTEbBQ; dkim-atps=neutral Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 4R76s74C3Kz1yXx for ; Sat, 22 Jul 2023 10:35:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0134C3850419 for ; Sat, 22 Jul 2023 00:35:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0134C3850419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689986114; 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=K/eTEbBQiLADJLqFoYLS+uY5sAZm4wy9EHk9CgbO6EymkpB8J4D+no2gx1oTDgNLy clwmW9oJGFQ5j1hqunxPoyCB7I7oVmeBFZH9gBMJ4I4K0erRLTPqx3FSfN14SKcGwy DUcNHlm+7e8BCBiQp4p+73nyRQHef/xOGbMe/pn8= 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-Google-Smtp-Source: APBJJlFYRlKXhslZ2jn1Qx0kiiJN1jkUQ+X6SSDkewwJ3B6cqE0VowGOuiHxOvJIsIMuiEAtlY22Jg== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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)