From ec2a9993595ac8e12058355d1b8c06fb6a5a8e99 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Sun, 12 Feb 2023 13:53:03 -0800 Subject: [PATCH] Add block names to irreducible-control-flow error --- src/backend/stackify.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/backend/stackify.rs b/src/backend/stackify.rs index aec02ea..67ca6a2 100644 --- a/src/backend/stackify.rs +++ b/src/backend/stackify.rs @@ -129,7 +129,13 @@ impl<'a, 'b> Context<'a, 'b> { log::trace!(" -> succ rpo {}", succ_rpo); if succ_rpo <= block_rpo { if !cfg.dominates(succ, block) { - anyhow::bail!("Irreducible control flow: edge from {} to {}", block, succ); + anyhow::bail!( + "Irreducible control flow: edge from {} ({}) to {} ({})", + block, + body.blocks[block].desc, + succ, + body.blocks[succ].desc + ); } // Backward branch. loop_headers.insert(succ);