]> git.ipfire.org Git - thirdparty/gcc.git/commit
avoid trying to set block in barriers [PR113506]
authorAlexandre Oliva <oliva@adacore.com>
Fri, 20 Dec 2024 21:01:53 +0000 (18:01 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 20 Dec 2024 21:01:53 +0000 (18:01 -0300)
commite7108c34a3685eaf9edd3b1fefbd3645b9bd8def
tree345c1b9905566d32e2d240c7634ae94fe875518b
parent0dc35fe5a095d9205da80cba976357cb71f8cb88
avoid trying to set block in barriers [PR113506]

When we emit a sequence before a preexisting insn and naming a BB to
store in the insns, we will attempt to store the BB even in barriers
present in the sequence.

Barriers don't expect blocks, and rtl checking catches the problem.

When emitting after a preexisting insn, we skip the block setting in
barriers.  Change the before emitter to do so as well.

for  gcc/ChangeLog

PR middle-end/113506
* emit-rtl.cc (add_insn_before): Don't set the block of a
barrier.

for  gcc/testsuite/ChangeLog

PR middle-end/113506
* gcc.target/riscv/pr113506.c: New.
gcc/emit-rtl.cc
gcc/testsuite/gcc.target/riscv/pr113506.c [new file with mode: 0644]