Re: [RISCV] redundant return-only BB not eliminated

Project / Subsystem

gcc / gcc

Date

2026-09-19

Proposer

Robert Guthrie <forkbombidable@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Potential for introducing regressions in specific edge cases (e.g., verbatim asm diffs) while optimizing CFG.
  • • Ensuring correct handling of CFG RTL modes is complex.

All attributes

project
gcc
subsystem
gcc
patch_id
—
discussion_id
aq7cmLNnJVp9Bzy9@bertguix
source_type
public_inbox
title
Re: [RISCV] redundant return-only BB not eliminated
headline
Redundant return-only BB elimination
tldr
Proposes a patch to eliminate redundant return-only basic blocks in CFG cleanup.
proposer
Robert Guthrie <forkbombidable@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Potential for introducing regressions in specific edge cases (e.g., verbatim asm diffs) while optimizing CFG.
  • • Ensuring correct handling of CFG RTL modes is complex.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • optimization
  • • cfg
  • • riscv
bugzilla_url
—
date
2026-09-19T00:00:00.000Z

Re: [RISCV] redundant return-only BB not eliminated

Robert Guthrie proposes a new patch to address the elimination of redundant return-only basic blocks. This change aims to simplify the control flow graph by merging consecutive blocks that only contain a return instruction. The patch passes most tests, with a minor noted issue on a verbatim asm diff.