GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
bitintlower

bitintlower: Remove stmts with zero lhs uses instead of trying to expand them [PR128994]

Improves bitint lowering by removing dead statements instead of processing them, fixing a coalescing confusion issue.

This commit modifies the gimple_lower_bitint pass to remove statements with no uses on their left-hand side (dead statements) rather than attempting to lower them. This change addresses an issue where the bitint coalescing mechanism was confused by these dead statements, leading to incorrect code generation. By removing them upfront, the compiler generates better code and avoids the confusion, also introducing a new test case to cover this scenario.

In Details

The gimple_lower_bitint pass previously attempted to lower statements like rotate, minmax, or abs even if their results were unused (zero lhs uses). This can occur after certain transformations or if dead code elimination passes are disabled. Such dead statements could confuse the bitint coalescing logic. This patch modifies the pass to remove these dead statements directly, improving code generation and fixing issues related to coalescing. It also adds a new test case (bitint-152.c) to verify this behavior.

For Context
bitintlower
The compiler pass responsible for lowering arbitrary-precision integers (_BitInt) into machine-representable operations.
zero lhs uses
Refers to statements where the result (left-hand side) is not subsequently used by any other part of the code, effectively making the statement dead code.
coalescing
A compiler optimization technique that merges similar or redundant operations to simplify code or improve efficiency. In this context, it refers to the process of combining bitint operations.
dead statements
Code constructs whose results are never used and therefore have no effect on the program's outcome.
SSA_NAME
Static Single Assignment form name. In SSA form, each variable has only one assignment, and each assignment to a variable creates a new version of that variable, distinguished by a version number.
Filed Under: bitintcompileroptimizationdead code