https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127201
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Philipp Tomsich <[email protected]>: https://gcc.gnu.org/g:5a3ad9374a73df7df7e8a00b1c06fbf30ad7298c commit r17-3944-g5a3ad9374a73df7df7e8a00b1c06fbf30ad7298c Author: Philipp Tomsich <[email protected]> Date: Sun Jul 26 14:03:26 2026 +0200 tree-data-ref: use DR_PTR_INFO points-to info in dr_may_alias_p [PR127201] Pointer SSA names created after the last points-to computation (e.g. by PRE re-materializing a load, gated on flag_tree_pre || flag_code_hoisting) carry no SSA_NAME_PTR_INFO. When dr_analyze_innermost re-expresses a data reference's base, DR_BASE_OBJECT can root at such a name, and ptr_derefs_may_alias_p then returns may-alias for lack of information. dr_analyze_alias already records that original solution in DR_PTR_INFO. Intersect the recorded solutions with pt_solutions_intersect before falling back to the rewritten base object. This is valid for cross-iteration queries because a points-to solution covers every dynamic value of the SSA name. The vectorizer already relies on this when it stamps DR_PTR_INFO onto the data-ref pointers it synthesizes (vect_duplicate_ssa_name_ptr_info). On SPEC CPU 2026's 722.palm_r, file advec_ws.fppized.f90, this removed (in one run measured on Aarch64) approx. 28.5% of the required runtime alias checks (3952 -> 2824) and all 18 in the hot loop, which then vectorized with no versioning at all. Bootstrapped and tested on x86_64-pc-linux-gnu. PR tree-optimization/127201 gcc/ChangeLog: * tree-data-ref.cc (dr_may_alias_p): Consult DR_PTR_INFO of both data references before falling back to base-object analysis. gcc/testsuite/ChangeLog: * gcc.dg/vect/vect-alias-check-ptr-info-1.c: New test. * gcc.dg/vect/vect-alias-check-ptr-info-2.c: New test.
