Handle points_away in prange::operator equal and not_equal
GCC's range comparison operators now correctly handle 'points-away' conditions.
GCC’s range comparison operators (== and !=) for pointer information have been updated to correctly produce a ‘points-away’ result when the objects are not equal and one has a defined points-to field. Additionally, ipa_record_return_value_range_1 now bails out early if a ‘points-away’ field is present, improving the robustness of alias analysis.
In Details
This commit modifies the overloaded operator== and operator!= for GCC's pointer range (prange) representation, specifically within range-op-ptr.cc. The logic in operator_equal::op1_range and operator_not_equal::op1_range is adjusted to emit a 'points-away' value when the comparison result is inequality and one of the operands has a defined points-to set. Furthermore, ipa_record_return_value_range_1 in ipa-prop.cc is updated to check for and bail out if a 'points-away' condition is encountered during return value range recording, enhancing the accuracy of interprocedural analys…
- prange
- Pointer range. A representation within GCC's analysis passes that tracks information about pointer values, including potential aliasing and points-to sets.
- points-to set
- The set of memory locations that a pointer might possibly point to, as determined by alias analysis.
- points-away
- A state in pointer analysis indicating that two pointers are known not to alias each other, or that a pointer cannot be resolved to a specific memory location.
- IPA
- Interprocedural Analysis. Compiler analysis that considers the entire program, including all functions, rather than just one function at a time.
- alias analysis
- Compiler analysis to determine whether different memory references might refer to the same location.