GIMPLE range inference refers to basic blocks, not statements.
GIMPLE range inference now correctly associates inferred ranges with basic blocks instead of individual statements.
GCC’s GIMPLE range inference has been corrected to associate inferred range elements with the basic block they belong to, rather than the originating statement. This change ensures that the management and removal of these range elements are tied to the correct basic block context. A new test case, pr127027.c, has been added to verify this correction.
In Details
The infer_range_manager in gimple-range-infer.cc stores inferred range elements. Previously, these elements (exit_range::bbi) pointed to a statement. This commit changes them to reference a basic block, as the primary use of these elements is to identify the basic block whose list they belong to for removal. Consequently, add_range now updates a block index, and clear operates on a specified block list.
- GIMPLE
- GCC's three-value intermediate representation (IR), which is a lower-level, simpler form than the user's source code or the compiler's higher-level tree representation. It is used for many optimization passes.
- basic block
- A contiguous sequence of basic instructions in a program where control flow enters at the beginning and leaves at the end without branching, except possibly at the end.
- range inference
- An optimization technique that determines the possible range of values a variable can take at different points in the program.