-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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 bug in procedure arguments with local interfaces #53420
Comments
@llvm/issue-subscribers-flang-frontend |
I was able to re-produce this with d832078904c. |
The problem is that the interface definition does not make it to the module file (m.mod). I'll take a look, but it will likely take me a while. No hard feelings if somebody with more experience and/or bandwidth wants to take over, just let me know. |
I have proposed a fix in |
This is much appreciated, thank you @ekieri ! |
Interfaces which are internal to a procedure need to be included in module files if (and only if) they are referenced in the interface of the procedure. That is, they are needed if they are the interfaces of dummy or return value procedures. Fixes llvm#53420 Differential Revision: https://reviews.llvm.org/D121738
Thank you. If I understand correctly, this fix was applied to the |
Applied to main, yes. I am afraid a backport is unlikely. Flang is still a work in progress, with many important features pending implementation. If you need this fix now, I advice you to build flang yourself: you could build the main branch, or locally cherry-pick this fix to a release branch. Please see https://llvm.org/docs/GettingStarted.html and https://github.com/llvm/llvm-project/blob/main/flang/README.md#building-flang for build instructions. |
This bug was breaking compilation of our Fortran 2003 electronic structure software with flang. Even if the developer team can patch flang and build a fixed 14.x compiler, there's little point in doing that if our users cannot access a fixed release. No backport means that we will have to consider that our code does not support flang < 15. |
@jme52 Technically speaking, there was no support for generating machine code or executables in LLVM Flang when the release 14 branch was created. Some bits were there, but not everything. And that’s mostly for F95. It’s a bit better now, but there are still a few key bits missing. So I am a bit surprised that you were able to build a F2003 application :) Which driver did you use - “flang” or “flang-new”? Just curious - it’s great to hear that people have been building real code with LLVM Flang! @ekieri To back port, we could just follow https://llvm.org/docs/GitHub.html#backporting-fixes-to-the-release-branches. |
At this point I was looking into the compilation of our code, I have not tested the executable yet. As for the driver, I was calling |
@jme52 This helps a lot, thank you!
No :) That's just a bash script.
Try here.
Indeed. It's really our fault not making this clearer. And you are not the first person to get confused by all this :) Perhaps this could help: https://reviews.llvm.org/D124848? |
Tested this with flang 11.1.0, 12.0.1 and 13.0.0.
Consider the following two codes:
m.f90
:and
n.f90
:Compiling with llvm generates error reports:
They are simply compiled with:
llvm-11.1.0:
llvm-12.0.1:
llvm-13.0.0:
This compiles fine with multiple other compilers and as far as we (@jme52) can tell is standard compliant.
The text was updated successfully, but these errors were encountered: