Page MenuHomePhabricator

[flang] Extension: forward refs to dummy args under IMPLICIT NONE
ClosedPublic

Authored by klausler on Feb 18 2021, 11:52 AM.

Details

Reviewers
tskeith
Summary

Most Fortran compilers accept the following benign extension,
and it appears in some applications:

SUBROUTINE FOO(A,N)
  IMPLICIT NONE
  REAL A(N) ! N is used before being typed
  INTEGER N
END

Allow it in f18 only for default integer scalar dummy arguments.

Diff Detail

Unit TestsFailed

TimeTest
310 msx64 debian > Clang.CodeGen::aarch64-poly-add.c
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/bin/clang -cc1 -internal-isystem /mnt/disks/ssd0/agent/llvm-project/build/lib/clang/13.0.0/include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +neon -disable-O0-optnone -emit-llvm -o - /mnt/disks/ssd0/agent/llvm-project/clang/test/CodeGen/aarch64-poly-add.c | /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -S -mem2reg | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/clang/test/CodeGen/aarch64-poly-add.c
290 msx64 windows > Clang.CodeGen::aarch64-poly-add.c
Script: -- : 'RUN: at line 3'; c:\ws\w64\llvm-project\premerge-checks\build\bin\clang.exe -cc1 -internal-isystem c:\ws\w64\llvm-project\premerge-checks\build\lib\clang\13.0.0\include -nostdsysteminc -triple arm64-none-linux-gnu -target-feature +neon -disable-O0-optnone -emit-llvm -o - C:\ws\w64\llvm-project\premerge-checks\clang\test\CodeGen\aarch64-poly-add.c | c:\ws\w64\llvm-project\premerge-checks\build\bin\opt.exe -S -mem2reg | c:\ws\w64\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w64\llvm-project\premerge-checks\clang\test\CodeGen\aarch64-poly-add.c

Event Timeline

klausler created this revision.Feb 18 2021, 11:52 AM
klausler requested review of this revision.Feb 18 2021, 11:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 11:52 AM
tskeith accepted this revision.Feb 18 2021, 12:04 PM
This revision is now accepted and ready to land.Feb 18 2021, 12:04 PM

+1 I have seen this being used in many weather simulation code.

klausler closed this revision.Feb 19 2021, 9:12 AM