Skip to content
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

[flang] Missing semantic error for procedure pointer target that is not known to be a procedure #73215

Closed
jeanPerier opened this issue Nov 23, 2023 · 5 comments
Assignees
Labels
flang:frontend question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@jeanPerier
Copy link
Contributor

The following program is accepted by flang, while all other compilers reject it:

  procedure(real), pointer :: p
  p => x
end

(Flang implicitly resolves x to be a procedure).

Failing tests in the llvm-test-suite:

https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/proc_ptr_46.f90
https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/proc_ptr_37.f90

@jeanPerier jeanPerier added bug Indicates an unexpected problem or unintended behavior flang:frontend labels Nov 23, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 23, 2023

@llvm/issue-subscribers-bug

Author: None (jeanPerier)

The following program is accepted by flang, while all other compilers reject it:
  procedure(real), pointer :: p
  p => x
end

(Flang implicitly resolves x to be a procedure).

Failing tests in the llvm-test-suite:

https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/proc_ptr_46.f90
https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/proc_ptr_37.f90

@llvmbot
Copy link
Collaborator

llvmbot commented Nov 23, 2023

@llvm/issue-subscribers-flang-frontend

Author: None (jeanPerier)

The following program is accepted by flang, while all other compilers reject it:
  procedure(real), pointer :: p
  p => x
end

(Flang implicitly resolves x to be a procedure).

Failing tests in the llvm-test-suite:

https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/proc_ptr_46.f90
https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/proc_ptr_37.f90

jeanPerier added a commit to jeanPerier/llvm-test-suite that referenced this issue Nov 23, 2023
These tests are looking for a semantic error that flang is not emitting
but they used to pass because a TODO for procedure pointers was emitted
in lowering. Lowering implemented procedure pointers, so these test
now fail. I opened an issue against semantics, but I want to comment
out these tests so that we can still land the lowering implementation
of procedure pointers that is correct.

See llvm/llvm-project#73215
jeanPerier added a commit to llvm/llvm-test-suite that referenced this issue Nov 23, 2023
These tests are looking for a semantic error that flang is not emitting
but they used to pass because a TODO for procedure pointers was emitted
in lowering. Lowering implemented procedure pointers, so these test
now fail. I opened an issue against semantics, but I want to comment
out these tests so that we can still land the lowering implementation
of procedure pointers that is correct.

See llvm/llvm-project#73215
@pklausler
Copy link

pklausler commented Nov 25, 2023

This behavior is intentional, as I could find no constraint or requirement from the standard being violated, and the interpretation is unambiguous.

jsrob1n pushed a commit to jsrob1n/llvm-test-suite that referenced this issue Nov 28, 2023
These tests are looking for a semantic error that flang is not emitting
but they used to pass because a TODO for procedure pointers was emitted
in lowering. Lowering implemented procedure pointers, so these test
now fail. I opened an issue against semantics, but I want to comment
out these tests so that we can still land the lowering implementation
of procedure pointers that is correct.

See llvm/llvm-project#73215
@klausler
Copy link
Contributor

Assigned back to Jean, who can respond to my comment or close the bug.

tarunprabhu pushed a commit to llvm-project-tlp/llvm-test-suite that referenced this issue Dec 8, 2023
These tests are looking for a semantic error that flang is not emitting
but they used to pass because a TODO for procedure pointers was emitted
in lowering. Lowering implemented procedure pointers, so these test
now fail. I opened an issue against semantics, but I want to comment
out these tests so that we can still land the lowering implementation
of procedure pointers that is correct.

See llvm/llvm-project#73215
@jeanPerier
Copy link
Contributor Author

I could also not find a constraint or requirement violation here. It seems rational to implicitly resolve the procedure pointer RHS as a procedure name just like they are implicitly resolved to procedure in call statements.
Closing the bug.

@jeanPerier jeanPerier removed the bug Indicates an unexpected problem or unintended behavior label Mar 19, 2024
@EugeneZelenko EugeneZelenko added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:frontend question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

5 participants