Correct inferred range application in GIMPLE.
Fixes incorrect range application logic in GIMPLE, improving optimization accuracy.
This commit corrects a logic error in GIMPLE’s range cache where inferred ranges were incorrectly applied even when abnormal outgoing edges existed in a block. The fix ensures that ranges are not exported from blocks with abnormal edges, preventing incorrect optimization assumptions. Additionally, a testcase was updated to correctly reflect the optimization flag requirement, ensuring accurate testing of this logic.
In Details
The ranger_cache::apply_inferred_ranges in gimple-range-cache.cc incorrectly updated inferred ranges when abnormal outgoing edges were present. This change modifies the logic to prevent range updates if any abnormal edges exist, aligning with the intended behavior of not exporting inferred information from blocks with unpredictable control flow. This impacts interprocedural analysis and optimization passes that rely on accurate range information.