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

gimplefe: Add support for REF_REVERSE_STORAGE_ORDER on mem

Enables the GIMPLE frontend to set and display the reverse storage order flag for memory references.

This commit enhances the GIMPLE frontend to support the REF_REVERSE_STORAGE_ORDER flag for memory references. Previously, it was difficult to determine if this flag was set on a MEM_REF. The change allows the GIMPLE frontend to set this flag and also enables it to be dumped in GIMPLE mode, aiding in debugging and ensuring correct handling of memory access order.

In Details

Extends the GIMPLE frontend (gimple-parser.cc) to parse and set REF_REVERSE_STORAGE_ORDER on MEM_REF nodes, addressing difficulties encountered while debugging PRs 126729 and 126570. It also updates tree-pretty-print.cc to dump this flag when present in GIMPLE output. This provides better visibility into memory access patterns involving reversed byte order, crucial for cross-endian compatibility and optimization.

For Context
GIMPLE
Generic Intermediate Representation. A three-address intermediate representation used by GCC after the initial parsing and before lower-level RTL transformations. It is designed to be simpler and easier to optimize than RTL.
gimplefe
The GIMPLE Frontend, responsible for processing C/C++ code and generating GIMPLE intermediate representation.
MEM_REF
A GCC internal representation for a memory reference, indicating an access to a specific memory location.
REF_REVERSE_STORAGE_ORDER
A flag indicating that the byte order within a multi-byte memory access is reversed relative to the target architecture's standard endianness. This is relevant for compatibility with systems of differing endianness.
Filed Under: gimplefrontenddebugging