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

Fortran submodule problem #98210

Closed
mfvalin opened this issue Jul 9, 2024 · 5 comments · Fixed by #98374
Closed

Fortran submodule problem #98210

mfvalin opened this issue Jul 9, 2024 · 5 comments · Fixed by #98374
Assignees

Comments

@mfvalin
Copy link

mfvalin commented Jul 9, 2024

cat ignore_tkr.F90
module machin
implicit none
interface ignore1
module subroutine ignore1(array)
implicit none
integer, dimension(*) :: array
#if defined(IGNORE)
!DIR$ ignore_tkr array
#endif
end
end interface
end module
cat truc.F90
submodule(machin) truc
use machin
implicit none
contains
module procedure ignore1
implicit none
call tagada1(array)
end
end submodule
======================================
flang-new -c ignore_tkr.F90
[software@nemesis ~/GITHUB-ECCC/librmn/build : (dev_alpha %|u=)]
flang-new -c truc.F90
error: Semantic errors in truc.F90
./truc.F90:2:7: error: Module 'machin' cannot USE itself
use machin
^^^^^^
./truc.F90:2:7: error: Cannot use-associate 'ignore1'; it is already declared in this scope
use machin
^^^^^^
./truc.F90:5:20: Previous declaration of 'ignore1'
module procedure ignore1
^^^^^^^
=====================================
flang-new -c ignore_tkr.F90 -DIGNORE
error: Semantic errors in ignore_tkr.F90
./ignore_tkr.F90:6:30: error: !DIR$ IGNORE_TKR may apply only in an interface or a module procedure
integer, dimension(
) :: array
^^^^^
========================================

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 9, 2024

@llvm/issue-subscribers-flang-frontend

Author: None (mfvalin)

> cat ignore_tkr.F90 module machin implicit none interface ignore1 module subroutine ignore1(array) implicit none integer, dimension(*) :: array #if defined(IGNORE) !DIR$ ignore_tkr array #endif end end interface end module > cat truc.F90 submodule(machin) truc use machin implicit none contains module procedure ignore1 implicit none call tagada1(array) end end submodule ====================================== > flang-new -c ignore_tkr.F90 [software@nemesis ~/GITHUB-ECCC/librmn/build : (dev_alpha *%|u=)] > flang-new -c truc.F90 error: Semantic errors in truc.F90 ./truc.F90:2:7: error: Module 'machin' cannot USE itself use machin ^^^^^^ ./truc.F90:2:7: error: Cannot use-associate 'ignore1'; it is already declared in this scope use machin ^^^^^^ ./truc.F90:5:20: Previous declaration of 'ignore1' module procedure ignore1 ^^^^^^^ ===================================== > flang-new -c ignore_tkr.F90 -DIGNORE error: Semantic errors in ignore_tkr.F90 ./ignore_tkr.F90:6:30: error: !DIR$ IGNORE_TKR may apply only in an interface or a module procedure integer, dimension(*) :: array ^^^^^ ========================================

@klausler
Copy link
Contributor

klausler commented Jul 9, 2024

delete the USE statement; the error on it is valid, and the later errors are consequences of it

@klausler klausler closed this as completed Jul 9, 2024
@EugeneZelenko EugeneZelenko added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label Jul 9, 2024
@mfvalin
Copy link
Author

mfvalin commented Jul 9, 2024

removing the use statement solves the first issue, thank you.

the ignore_tkr issue remains (compiling with -DIGNORE)
./ignore_tkr.F90:6:30: error: !DIR$ IGNORE_TKR may apply only in an interface or a module procedure
integer, dimension(*) :: array

@klausler klausler reopened this Jul 9, 2024
@klausler klausler self-assigned this Jul 9, 2024
@klausler
Copy link
Contributor

klausler commented Jul 9, 2024

I'll check that out.

klausler added a commit to klausler/llvm-project that referenced this issue Jul 10, 2024
We emit an incorrect error message when !DIR$ IGNORE_TKR appears
in a separate module procedure's interface declaration.

Fixes llvm#98210.
@klausler
Copy link
Contributor

#98374

@EugeneZelenko EugeneZelenko removed the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label Jul 10, 2024
klausler added a commit that referenced this issue Jul 11, 2024
)

We emit an incorrect error message when !DIR$ IGNORE_TKR appears in a
separate module procedure's interface declaration.

Fixes #98210.
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this issue Jul 14, 2024
…m#98374)

We emit an incorrect error message when !DIR$ IGNORE_TKR appears in a
separate module procedure's interface declaration.

Fixes llvm#98210.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants