The following patch is for

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117248

The first patch variant resulted in PR117999 (new libgo test failures).

The patch was successfully bootstrapped and tested on x86-64.

The patch was also checked for libgo on arm for PR11799.

commit 936058ce9ed159b4c4b7c45975b848d843457134
Author: Vladimir N. Makarov <vmaka...@redhat.com>
Date:   Wed Dec 18 14:00:38 2024 -0500

    [PR117248][LRA]: Fix calculation of conflict hard regs of pseudo
    
    The 1st patch for PR117248 resulted in PR117299 (libgo failures on arm).  So this is a patch
    solving the problem in another way.
    
    gcc/ChangeLog:
    
            PR rtl-optimization/117248
            * lra-lives.cc (process_bb_lives): Update conflict hard regs even
            when clobber hard reg is not marked as dead.

diff --git a/gcc/lra-lives.cc b/gcc/lra-lives.cc
index 510f7d927ab..94cb000bc5a 100644
--- a/gcc/lra-lives.cc
+++ b/gcc/lra-lives.cc
@@ -1006,7 +1006,15 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p)
 						      clobbered_regset))
 		break;
 	    if (reg2 == NULL)
-	      make_hard_regno_dead (reg->regno);
+	      {
+		make_hard_regno_dead (reg->regno);
+	      }
+	    else
+	      {
+		EXECUTE_IF_SET_IN_SPARSESET (pseudos_live, j)
+		  SET_HARD_REG_BIT (lra_reg_info[j].conflict_hard_regs,
+				    reg->regno);
+	      }
 	  }
 
       /* Increment the current program point if we must.  */

Reply via email to