Cranelift: disallow marking entry block 'cold'. (#4659)

This is a nonsensical constraint: the entry block must come first in the
compiled code's layout, so it cannot also be sunk to the end of the
function.

This PR modifies the CLIF verifier to disallow this situation entirely.
It also adds an assert during final block-order computation to catch the
problem (and avoid a silent miscompile) even if the verifier is
disabled.

Fixes #4656.
This commit is contained in:
Chris Fallin
2022-08-09 11:52:30 -07:00
committed by GitHub
parent 66025636fd
commit 953f83e6ac
3 changed files with 40 additions and 16 deletions

View File

@@ -0,0 +1,6 @@
test verifier
function %entry_block_not_cold() {
block0 cold: ; error: entry block cannot be marked as cold
return
}