From patchwork Thu Jan 25 19:47:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1890991 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H7X/1RIN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TLWb52ZH2z23fD for ; Fri, 26 Jan 2024 06:48:17 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4E39F3858C42 for ; Thu, 25 Jan 2024 19:48:15 +0000 (GMT) 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 CE6F43858C98 for ; Thu, 25 Jan 2024 19:47:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE6F43858C98 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CE6F43858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706212071; cv=none; b=bO3yZPEuZDHS4h2JXeB8AbVu1YMCw4/ibfmcjusdSJyEMYkfiJZeIDfy0r8uzB2C5l2piPV+t33fKbW3NVdRFQn/TmCmvXRV+Xw0NoSlxNjAOGQg1dHjfORSEttjWz6vp7scjj/C4B/50k1XRq2KKdh18Jq93hTvupKM9PrY1iA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706212071; c=relaxed/simple; bh=9rvW+QJFkWrfJhp8KTOzakWM8kUuE/XLa3p/bmtxkuY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=mgaWNL+2DDKOhJlL3yMObFgyXp4qkWyW+1AFA2BIL7frxWhJJ1pt9EPKzTeqqPkSRQg84QWz7xAqjzG7wMVou8Bj7OzXvh3LmRvVOAlZs0d/nCx0sqql90jHIdzmZL6C/h6Dha90XdN+5rdYXfpcvk46uwyr5dH4pmb4QKo0Wo0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706212069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=SHoxGju2uJmeA0AswY+TroUfQgM+NWPUxyx7GhF9XKs=; b=H7X/1RINXAaTMsblBgpMiBl8+fpBl7KO2O8hbgUbGotu9BBcKPAACg+qtZ5+lglNSTnoMJ 64IjQFXWAQmP12Ax/npQhUwVegLE7Vy6gaWdepa5swj7BSfhjOAYa0E3gOdGImubh99K6Y oHMmKiM2/VnwDTEJRrtoPfP2GS+jKG0= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361--BjYNf5dNeGehfG85D4MAQ-1; Thu, 25 Jan 2024 14:47:47 -0500 X-MC-Unique: -BjYNf5dNeGehfG85D4MAQ-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-5eb6dba1796so110386147b3.1 for ; Thu, 25 Jan 2024 11:47:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706212066; x=1706816866; 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=z6ADe9BaOFPGjB7slxD+wYrZnLqcNUbaJvyJAynYAhM=; b=NsS3x/8/sVVKlTSSmEjP3f2RjfEBj1fUOgOppLBF19U1Wj13E3F0jOPVcOm6iZznTk BaWuZndk8n3MgHloJv9++EFbNOnfxGVd3xdjmwLRpxSyuuhsE3/9MWg7+6dJLMkuovPb DMIXHOM3vmAUSvgGKWczI2i+n3dV79IE1eI0Dwp+HIxA9zsTjcZSGo8Hy4JAbzkXMuCA DTivuEtoVlA63HAuXw54nuh5DqtwfAdq3qn5S/yprdBkXWNmacYSziUvU6wOpPS/oxTG qqZA8ymmZROK7Rr+ESgWglhipPkEi4fCaWurCNyuREURLmgZ7EJrbskheFQ2GCrlGapO clJQ== X-Gm-Message-State: AOJu0YzPk8p9kZdpdXc2cK7nL2VG4uoTPAfcmMmMfwlS+Lrw6E2zppxI 1BTbBWbxQxJC2HPS3m4LspE5QF3+7THunsS4DQJKllsh1XkHyiV3yeSa9e986bSs68sTbyT6jcV sMdBg4nxKDfTjG+EN50ect2/ggwWUVKVipP98B9kYoJWsqf+uuCJ4getu2UIIiMVI33n86AdutV FkAiLfdGA4u9rEQnlp4xYBDBj3AKp2gVbZw2qgQ+g= X-Received: by 2002:a05:6902:18c6:b0:dc2:66ab:4bc0 with SMTP id ck6-20020a05690218c600b00dc266ab4bc0mr391981ybb.36.1706212066545; Thu, 25 Jan 2024 11:47:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUu30zbufH6aytdYvek0ZHJEuui1GpUQfLAK2PN5I3f3xWr15wCRTVOt+SNNanEmw77jVKhg== X-Received: by 2002:a05:6902:18c6:b0:dc2:66ab:4bc0 with SMTP id ck6-20020a05690218c600b00dc266ab4bc0mr391968ybb.36.1706212066108; Thu, 25 Jan 2024 11:47:46 -0800 (PST) Received: from [192.168.1.88] (23-233-12-249.cpe.pppoe.ca. [23.233.12.249]) by smtp.gmail.com with ESMTPSA id o4-20020a056214180400b006819636ba87sm5769899qvw.7.2024.01.25.11.47.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jan 2024 11:47:45 -0800 (PST) Message-ID: <3ffb5278-64a4-884f-1b57-665bd73b5f9b@redhat.com> Date: Thu, 25 Jan 2024 14:47:44 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: [pushed][PR113526][LRA]: Fixing asm-flag-1.c failure on ARM X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113526 The patch was successfully bootstrapped and tested on x86-64, ppc64le, and aarch64. commit 5c617df410602d0e51d61c84d1ae7e9b3f51efa4 Author: Vladimir N. Makarov Date: Thu Jan 25 14:41:17 2024 -0500 [PR113526][LRA]: Fixing asm-flag-1.c failure on ARM My recent patch for PR113356 results in failure asm-flag-1.c test on arm. After the patch LRA treats asm operand pseudos as general regs. There are too many such operands and LRA can not assign hard regs to all operand pseudos. Actually we should not assign hard regs to the operand pseudo at all. The following patch fixes this. gcc/ChangeLog: PR target/113526 * lra-constraints.cc (curr_insn_transform): Change class even for spilled pseudo successfully matched with with NO_REGS. diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc index 3379b88ff22..0ae81c1ff9c 100644 --- a/gcc/lra-constraints.cc +++ b/gcc/lra-constraints.cc @@ -4498,10 +4498,10 @@ curr_insn_transform (bool check_only_p) registers for other pseudos referenced in the insn. The most common case of this is a scratch register which will be transformed to scratch back at the end of LRA. */ - && lra_get_regno_hard_regno (regno) >= 0 && bitmap_single_bit_set_p (&lra_reg_info[regno].insn_bitmap)) { - lra_change_class (regno, NO_REGS, " Change to", true); + if (lra_get_allocno_class (regno) != NO_REGS) + lra_change_class (regno, NO_REGS, " Change to", true); reg_renumber[regno] = -1; } /* We can do an optional reload. If the pseudo got a hard