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

Instruction location management refactored

Replaces older macros with member functions for managing instruction locations in RTL.

This commit modernizes the management of instruction locations within GCC’s RTL (Register Transfer Language). It replaces the older INSN_LOCATION and INSN_HAS_LOCATION macros with new member functions (location, set_location, has_location) directly on the rtx_insn structure. This change improves code clarity and consistency across various compiler passes and target backends.

In Details

GCC's internal representation of instructions, rtx_insn, previously used macros (INSN_LOCATION, INSN_HAS_LOCATION) to manage source code location information. This commit refactors this by introducing member functions (location, set_location, has_location) directly into the rtx_insn structure. This change affects numerous RTL manipulation and emission code paths across various compiler passes and target-specific backends, standardizing how instruction location data is accessed and modified.

For Context
RTL
Register Transfer Language, an intermediate representation used by GCC to represent programs after the front-end has parsed them. It describes operations on registers and memory.
rtx_insn
The internal GCC data structure representing an assembly instruction within the RTL. It holds information about the instruction's operation, operands, and associated metadata.
GCC passes
Distinct stages or transformations within the GCC compiler that process the intermediate representation (like RTL) to optimize or translate the code.
Filed Under: gccrtlrefactor