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

Split locals that are overwritten with a different rtx.

Improve RTL handling for local variables that are reassigned in Alpha, ARC, Or1k, and other architectures.

This commit refactors how local variables that are overwritten are handled in several GCC backends, including Alpha, ARC, and Or1k. It ensures that code labels are kept separate from LABEL_REFs, and that patterns, parallel blocks, and producer/consumer constructs are managed distinctly from the emitted instructions. This improves the clarity and correctness of RTL generation for complex operations like atomic memory accesses, compare-and-swap, and conditional moves, especially when local variables are involved in multiple assignments.

In Details

This commit introduces a more robust handling of RTL constructs for local variables that are subject to overwrites or complex updates across various GCC targets (e.g., Alpha, ARC, Or1k, RS6000, S390, arm). Key changes include separating code labels from LABEL_REF, keeping PARALLEL constructs distinct from emitted instructions, and managing producer/consumer patterns independently. This is particularly relevant for implementing atomic operations and optimized memory accesses where the state of local variables can change unpredictably. The changes also involve passing rtx_insn * in specif…

For Context
RTL
Register Transfer Language, an intermediate representation used by GCC to represent code between parsing and machine-specific code generation. It's a Lisp-like language of expressions.
LABEL_REF
An RTX representing a reference to a label within the code. It's used to establish control flow and addressing within GCC's intermediate representation.
rtx_insn
An RTX (Real-Time Expression) object representing a GCC internal representation of a machine instruction. rtx_insn * is a pointer to such an instruction.
PARALLEL
An RTL construct in GCC used to represent a group of operations that can potentially be executed in parallel or as a single atomic unit, often seen in instruction scheduling or complex instruction emulation.
atomic operations
Operations (like read-modify-write) that are guaranteed to execute indivisibly, without interruption from other threads or processes. Compilers must generate specific instructions to ensure atomicity.
Filed Under: rtlcode generationatomic