diff options
author | Vladimir N. Makarov <vmakarov@redhat.com> | 2022-03-25 12:22:08 -0400 |
---|---|---|
committer | Vladimir N. Makarov <vmakarov@redhat.com> | 2022-03-25 12:30:54 -0400 |
commit | 25725506b85f478076770942d76799c54310c696 (patch) | |
tree | bb8caa9303d8a522658055ce9c7b5c189d2973dc /gcc | |
parent | fe705dce2e1e3e4e5e0c69d7f9adaf7f2777cdc8 (diff) | |
download | gcc-25725506b85f478076770942d76799c54310c696.zip gcc-25725506b85f478076770942d76799c54310c696.tar.gz gcc-25725506b85f478076770942d76799c54310c696.tar.bz2 |
[PR104971] LRA: check live hard regs to remove a dead insn
LRA removes insn modifying sp for given PR test set. We should also have
checked living hard regs to prevent this. The patch fixes this.
gcc/ChangeLog:
PR middle-end/104971
* lra-lives.cc (process_bb_lives): Check hard_regs_live for hard
regs to clear remove_p flag.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lra-lives.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/lra-lives.cc b/gcc/lra-lives.cc index 796f006..a755464 100644 --- a/gcc/lra-lives.cc +++ b/gcc/lra-lives.cc @@ -724,7 +724,10 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) bool remove_p = true; for (reg = curr_id->regs; reg != NULL; reg = reg->next) - if (reg->type != OP_IN && sparseset_bit_p (pseudos_live, reg->regno)) + if (reg->type != OP_IN + && (reg->regno < FIRST_PSEUDO_REGISTER + ? TEST_HARD_REG_BIT (hard_regs_live, reg->regno) + : sparseset_bit_p (pseudos_live, reg->regno))) { remove_p = false; break; |