From bc8f0f1f88d95a284aa329fbc7e70e0b529eaa2a Mon Sep 17 00:00:00 2001 From: "Vladimir N. Makarov" Date: Tue, 24 Nov 2020 11:25:16 -0500 Subject: [PATCH] [PR97933] LRA: find correctly last empty dest block. gcc/ 2020-11-24 Vladimir Makarov PR bootstrap/97933 * lra.c (lra_process_new_insns): Stop on the first real insn after head of e->dest. --- gcc/lra.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gcc/lra.c b/gcc/lra.c index b318cfd7456..4ec0f466376 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -1908,11 +1908,9 @@ lra_process_new_insns (rtx_insn *insn, rtx_insn *before, rtx_insn *after, tmp = NEXT_INSN (tmp); if (NOTE_INSN_BASIC_BLOCK_P (tmp)) tmp = NEXT_INSN (tmp); - for (curr = tmp; - curr != NULL - && (!INSN_P (curr) || BLOCK_FOR_INSN (curr) == e->dest); - curr = NEXT_INSN (curr)) - ; + for (curr = tmp; curr != NULL; curr = NEXT_INSN (curr)) + if (INSN_P (curr)) + break; /* Do not put reload insns if it is the last BB without actual insns. In this case the reload insns can get null BB after emitting. */ -- 2.30.2