[flang-commits] [flang] [flang][AliasAnalysis] Cray pointers/pointees might alias with anything (PR #170900)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Dec 8 09:27:08 PST 2025


tblah wrote:

This is not from an application.

When I landed https://github.com/llvm/llvm-project/pull/169544 the buildbots alerted me to a failing gfortran test: https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/cray_pointers_10.f90. The problem was that the alias analysis information incorrectly said that the cray pointer could not alias with z and so the if was thought to be always true.

Before #169544, all pointers (including the cray pointee) could alias with almost everything. The intention of my patch was to refine that such that fortran standard pointers only alias with TARGETs. This change allows us to keep cray pointees aliasing with everything.

I would be surprised if this leads to regressions because for most cases this will produce the same result as current HEAD, although perhaps I might need to be less conservative about the cray pointer (not pointee)?

Alternatively we could disable the gfortran test, but I think it would be better to handle cray pointers correctly than produce incorrect code for something that semantics allows without a warning.

https://github.com/llvm/llvm-project/pull/170900


More information about the flang-commits mailing list