public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-7817] [PR104971] LRA: check live hard regs to remove a dead insn Date: Fri, 25 Mar 2022 16:31:04 +0000 (GMT) [thread overview] Message-ID: <20220325163104.B25D63857034@sourceware.org> (raw) https://gcc.gnu.org/g:25725506b85f478076770942d76799c54310c696 commit r12-7817-g25725506b85f478076770942d76799c54310c696 Author: Vladimir N. Makarov <vmakarov@redhat.com> Date: Fri Mar 25 12:22:08 2022 -0400 [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. Diff: --- gcc/lra-lives.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/lra-lives.cc b/gcc/lra-lives.cc index 796f00629b4..a755464ee81 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;
reply other threads:[~2022-03-25 16:31 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220325163104.B25D63857034@sourceware.org \ --to=vmakarov@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).