GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/expmed

Use store_bit_field for unsplittable targets

Fixes an ICE in extract_integral_bit_field by using store_bit_field for unsplittable targets, improving robustness.

This change modifies extract_integral_bit_field to use store_bit_field when a target cannot be split into subregisters. This prevents an ICE that could occur after recent changes to regmode_natural_size. For RISC-V, this may introduce a spill per iteration, which is noted as a potential area for future mitigation.

In Details

The extract_integral_bit_field function in expmed.cc previously assumed targets could always be split into subregisters. With recent regmode_natural_size changes, unsplittable targets like reg:V2DF can cause an ICE. This commit introduces a fallback to store_bit_field when operand_subword fails, ensuring correct handling of such targets and preventing the ICE.

For Context
ICE
Internal Compiler Error. A condition that prevents GCC from completing a compilation, often due to an unrecoverable state in the compiler's internal logic.
regmode_natural_size
A GCC internal concept that defines the natural size of a machine mode for a register. Changes here can affect how subregisters are handled.
store_bit_field
A GCC internal function or mechanism for storing a bit field into a target, likely handling cases where the field might not align perfectly or span register boundaries.
operand_subword
Likely a GCC internal function related to accessing or manipulating sub-parts of a register operand, often used when dealing with bit fields or smaller data types within a larger register.
Filed Under: optimizationcompiler-error