Skip to content

[Fortran] disable pointer_check_11.f90 which exhibits UB #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 15, 2025

Conversation

tblah
Copy link
Contributor

@tblah tblah commented Apr 15, 2025

This test calls an empty subroutine with a null pointer as an argument. In gfortran it is hoped that a flag will detect this and produce an error. Flang does not perform any such analysis, and so on some machines when optimization is enabled, this test never terminates. I don't think this is a flang bug as such because the input code is doing undefined behavior.

This test calls an empty subroutine with a null pointer as an argument.
In gfortran it is hoped that a flag will detect this and produce an
error. Flang does not perform any such analysis, and so on some machines
when optimization is enabled, this test never terminates. I don't think
this is a flang bug as such because the input code is doing undefined
behaviour.
@tblah tblah requested review from tarunprabhu and pawosm-arm April 15, 2025 14:41
@pawosm-arm
Copy link

pawosm-arm commented Apr 15, 2025

I can confirm this is happening. Built with -O0 (which is the default for the Debug build of this test suite), this program crashes as expected. Built with -O3 (which is the default for the Release build) it spins forever until is hit by the 2h timeout (and this is reported as passing successfully after all!). Since this is UB, all bets are off, and compiler is allowed to do whatever when optimizing it at -O3, so one can't claim it as incorrect compiler's behavior.

Copy link
Contributor

@tarunprabhu tarunprabhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment describing why it is being disabled? At some point, the disabled tests need to be reviewed and a comment like this would be a great help.

Thanks.

@pawosm-arm pawosm-arm added this to the release/20.x milestone Apr 15, 2025
@tblah tblah merged commit 0bbf038 into llvm:main Apr 15, 2025
1 check passed
@pawosm-arm
Copy link

Could you consider cherry-picking it to the release/20.x branch?

@pawosm-arm
Copy link

/cherry-pick 0bbf038

tblah added a commit to tblah/llvm-test-suite that referenced this pull request Apr 15, 2025
This test calls an empty subroutine with a null pointer as an argument.
In gfortran it is hoped that a flag will detect this and produce an
error. Flang does not perform any such analysis, and so on some machines
when optimization is enabled, this test never terminates. I don't think
this is a flang bug as such because the input code is doing undefined
behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants