[llvm-bugs] [Bug 52152] New: IGNORE_TKR directive with gfortran

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 12 02:21:02 PDT 2021


            Bug ID: 52152
           Summary: IGNORE_TKR directive with gfortran
           Product: flang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedbugs at nondot.org
          Reporter: gilles at rist.or.jp
                CC: David.Truby at arm.com, jperier at nvidia.com,
                    kirankumartp at gmail.com, llvm-bugs at lists.llvm.org,
                    sscalpone at nvidia.com

Created attachment 25356
  --> https://bugs.llvm.org/attachment.cgi?id=25356&action=edit
a reproducer to evidence the issue

The attached conftest.f90 program can be used in order to evidence the issue.

gfortran -c conftest.f90

should work (it can issue a warning related to an type/interface mismatch, but
that can be ignored).

Now the same file fails to compile with flang resulting into an error in the
gfortran backend

> Error: Rank mismatch in argument 'buffer' at (1) (rank-1 and scalar)

What happens is the 'buffer' dummy argument of the 'foo' subroutine has the
following directive

       !GCC$ ATTRIBUTES NO_ARG_CHECK :: buffer

This is GCC specific (as the !GCC$ sentinel implies), and is simply stripped by
Consequently, the flang-processed file contains no such directive and hence
gfortran fails.

flang offers a similar directive
that is passed as-is to gfortran.

Unfortunately, gfortran does not understand this directive and the compilation

Of course, one option is to have the fine GNU folks update gfortran to support
this directive.

Other options at the flang level could be to
 - pass through unknown and/or gfortran specific directives
 - translate flang to gfortran directives

Will you be willing to consider doing something about that at the flang level?

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211012/738c8f30/attachment.html>

More information about the llvm-bugs mailing list