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

AVR: Add TImode to MPUSH iterator for vector(16) memory passing

AVR target now supports passing vector(16) in memory by adding TImode to MPUSH instruction selection.

This commit enhances the AVR target’s instruction selection for memory passing of vector(16) types. It adds TImode to the MPUSH mode iterator, which determines available push instructions. This fix, addressing PR 127098, resolves issues with expr.cc on STACK_GROWS_DOWNWARDS + POST_DEC push operations by providing the necessary instruction support.

In Details

Adds TImode to the MPUSH mode iterator in config/avr/avr.md to support passing vector(16) in memory, as per PR 127098. This addresses an issue where expr.cc did not properly handle STACK_GROWS_DOWNWARDS + POST_DEC push operations. The change ensures correct instruction selection for these cases on the AVR target, including a new test case gcc.target/avr/torture/pr127098.c.

For Context
AVR
A family of microcontrollers manufactured by Atmel (now Microchip Technology).
TImode
A GCC machine mode representing a 16-bit integer type.
MPUSH
A machine-dependent instruction on some architectures (like AVR) used for pushing multiple values onto the stack.
vector(16)
A data type representing a vector of 16 elements. The size and type of elements would be context-dependent.
STACK_GROWS_DOWNWARDS
A target-specific macro indicating that the stack pointer decreases as data is pushed onto the stack.
POST_DEC
A target-specific instruction modifier indicating that the stack pointer is decremented after the push operation.
Filed Under: AVRtargetinstruction selection