Landing: 9f7a095e81bd

Project / Subsystem

gcc / gcc

Date

2026-10-01

Author

Richard Biener

Commit

9f7a095e81bd3bafbc0fd66ab210a962ff32a801

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
—
commit_hash
9f7a095e81bd3bafbc0fd66ab210a962ff32a801
source_type
github
headline
Fix missed constant folding of _BitInt return values.
tldr
GCC can now constant fold functions returning _BitInt types by checking the return type instead of the mode.
author
Richard Biener
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • compiler
  • • type system
discussion_id_link
—
bugzilla_pr
—
date
2026-10-01T00:00:00.000Z

This commit resolves an issue where GCC failed to constant fold functions returning _BitInt types. The problem stemmed from a check that incorrectly used SCALAR_INT_MODE_P on BLKmode, which does not apply to _BitInt. The fix replaces this mode check with a direct check of the return type, enabling constant folding for these types and a new test case verifies the correction.