From 4b77a3806c4f2e27d149da326a689286043e433c Mon Sep 17 00:00:00 2001 From: Kwok Cheung Yeung Date: Sun, 10 Nov 2019 18:22:38 +0000 Subject: [PATCH] [LRA] Do not use eliminable registers for spilling The liveness of eliminable hard registers is not tracked by LRA between basic blocks, so they should not be used as spill registers as LRA may decide to allocate them to pseudos while the spilled value is still live. 2019-11-10 Kwok Cheung Yeung gcc/ * lra-spills.c (assign_spill_hard_regs): Do not spill into registers in eliminable_regset. From-SVN: r278024 --- gcc/ChangeLog | 5 +++++ gcc/lra-spills.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02b24d3b4b1..8b7ed6358c3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-10 Kwok Cheung Yeung + + * lra-spills.c (assign_spill_hard_regs): Do not spill into + registers in eliminable_regset. + 2019-11-10 Jan Hubicka * ipa-inline.c (compute_uninlined_call_time, diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c index 0068e52ace1..54f76ccf864 100644 --- a/gcc/lra-spills.c +++ b/gcc/lra-spills.c @@ -283,6 +283,8 @@ assign_spill_hard_regs (int *pseudo_regnos, int n) for (k = 0; k < spill_class_size; k++) { hard_regno = ira_class_hard_regs[spill_class][k]; + if (TEST_HARD_REG_BIT (eliminable_regset, hard_regno)) + continue; if (! overlaps_hard_reg_set_p (conflict_hard_regs, mode, hard_regno)) break; } -- 2.30.2