GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc Performance Win

More memory efficient prange_storage

The `prange_storage` class now uses a more memory-efficient storage format that only allocates the required number of words.

The prange_storage class in GCC’s value range propagation infrastructure is now more memory efficient. It uses a new prange_format class to store only the required words to storage. This reduces memory consumption, improving overall performance, particularly when dealing with many variables with restricted ranges.

In Details

This commit introduces prange_format and prange_kind to optimize the memory usage of prange_storage in value-range-storage.cc and value-range-storage.h. Instead of allocating a fixed amount of storage, it now allocates only the words required based on the prange_kind. This change affects how value ranges are stored and accessed, impacting various value range propagation analyses. Toolchain engineers should pay attention to the new enum, format class and the modified access methods get_word and set_word.

For Context

Value range propagation is a compiler optimization technique where the compiler determines the possible range of values a variable can hold. This allows for more aggressive optimizations like dead code elimination. prange_storage is the internal class that stores these ranges. This commit reduces the memory footprint of this class, which can lead to better overall compiler performance, especially when compiling code with lots of range-constrained variables.

Filed Under: gccvalue-rangeoptimizationmemory