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

Project / Subsystem

gcc / gcc

Date

2026-09-04

Proposer

Jeff Law <jeffrey.law@oss.qualcomm.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Complexity of CFG manipulation across different optimization modes.
  • • Ensuring correctness of edge redirection and fall-through handling.

All attributes

project
gcc
subsystem
gcc
patch_id
—
discussion_id
df047a71-775f-4901-b717-aad0aa08a659@oss.qualcomm.com
source_type
public_inbox
title
Re: [RISCV] redundant return-only BB not eliminated
headline
redundant return-only BB not eliminated
tldr
Discussion on the complexities of eliminating redundant return-only basic blocks in GCC, considering different optimization modes.
proposer
Jeff Law <jeffrey.law@oss.qualcomm.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Complexity of CFG manipulation across different optimization modes.
  • • Ensuring correctness of edge redirection and fall-through handling.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • gcc
  • • optimization
  • • cfg
  • • risc-v
bugzilla_url
—
date
2026-09-04T00:00:00.000Z

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

Jeff Law provides guidance on eliminating redundant return-only basic blocks in GCC, explaining that it can be done after prologue/epilogue threading. The discussion touches on the differences between CFGRTL and CFGLAYOUT modes and how the optimization should conceptually work by examining predecessors of the exit block.