[Fortran] Intel's ICE in frontend with incorrect interfaces
Assuming one has the following code:
subroutine test_b(b)
real(8) :: b
interface
subroutine test_a
end subroutine test_a
end interface
call test_a
end subroutine test_b
subroutine test_a(a)
real :: a
end subroutine test_a
Intel Fortran frontend fails with ICE that makes difficult to determine a place where the errors are. An example: https://godbolt.org/z/f4hj99f88
The issue comes from using of incompatible interfaces (or declaration + interface) in single file.
Original report on Intel Fortran Compiler Forum: https://community.intel.com/t5/Intel-Fortran-Compiler/ICE-ifx-with-interface-declara/m-p/1538601/highlight/true#M168920
Hi @foxtran,
Thanks for the suggestion!
This case would be a bit different from most catalog entries. Existing recommendations generally focus on improving the code, whereas this scenario addresses an actual error. And for that we usually have PWDs, but existing entries focus on parallel programming issues, which compilers rarely catch.
That said, we recently included PWR079 to cover an actual error in the code, and it overlaps with some compiler diagnostics. It belongs to the "correctness" category, and your scenario would also fit nicely there. I don't see any particular reason why we couldn't turn this into a new catalog entry.
As always, we'll keep this issue open as we handle it. In the meantime, feel free to submit a PR with a proposal if you are interested! I've included tips below on how to add a new entry to the catalog.
Thanks again for your multiple contributions lately!
Steps for adding a new recommendation (click me)
-
Each recommendation resides in its own directory under
Checks/. Create the directory and update the list of checks in theREADME.mdat the root of the repository. -
Add a
README.mdfile that includes the following:-
Title: ID (e.g., the next available
PWRnumber) + Name of the recommendation. - Issue: A brief description (1-2 sentences) of how the discouraged practice impacts the code.
- Actions: A brief explanation (1-2 sentences) of how to refactor the code from the discouraged to the encouraged practice.
- Relevance: A more detailed explanation of why adopting the recommended practice is beneficial, expanding on the previous points.
- Code examples: Include a before-and-after code example to illustrate the improvement.
- References: Add links or references for further reading, if available.
-
Title: ID (e.g., the next available
-
Create standalone
exampleandsolutionsource files containing the code examples. -
Optionally, include a benchmark demonstrating the before-and-after performance impact of the change. In cases like this, the expectation is that the performance of the code should not degrade.
For reference, feel free to check out previous PRs to see how these steps are implemented in practice. For example, this is the PR that added PWR075.
Naturally, don't hesitate to ask at any moment if you have any issues. We'll be glad to help!