On 1/2/25 12:04 PM, Harald Anlauf wrote:
Dear all,

this patch addresses overeager optimization of Cray pointers when
used in comparisons.  Cray pointers are non-standard, and odd in a
sense that they were introduced before modern Fortran pointers.
Comparisons with e.g. a "NULL" pointer are actually comparisons
with integer zero etc., which means that while they are references
they can actually be "NULL" to mimic a disassociated pointer.
The only solution I could find was treating them locally as volatile
when used in a comparison.  If someone has a better solution, please
share!

As this is a local solution, and a real-world legacy code using Cray
pointers would likely never use such a test in a vectorizable loop,
I expect negligible (performance and code-size) impact.

Regtested on x86_64-pc-linux-gnu.  OK for mainline?

This PR is marked as a regression (since gcc-7), is this OK for
a (limited?) backport?

Thanks,
Harald


The hack is fairly isolated and simple. The problem is a quirk from the past. The only way to expose an issue is to get it into the real world and see if anyone notices a problem.

OK for trunk and maybe 14.  If you think farther back, up to you.

Jerry

Reply via email to