Request advice on reporting many errors found in Fortran test sets

Hello.
Fujitsu is very interested in flang and would like to help improve its quality.
To confirm the ability of flang, we used flang to compile and execute some of our test sets (FORTRAN 77, 90, 95). The result was that 3447 of the 8247 programs failed. However, errors with the same cause are counted more than once.

Errors can be classified as follows:
- Compilation Error: “not yet implemented:” and “TODO:”
- Compilation Error
- Fujitsu Specific Features
- Runtime result error
- Internal error
By removing “not yet implemented:”, “TO DO:”, “Duplicate Error”, “Fujitsu Specific Errors”, etc., the number of errors is reduced. However, there will still be many errors.

First, we will issue the bug reports on errors related to language standards that we consider important.
If there is any guidance or advice from the community, please let us know.
Since there will be too many issues to report, we would like to determine the priority.

1 Like

Thanks @ohno-fj for trying out flang. It will be interesting for the developers to have a quick look at the list of errors. I think there are two ways to proceed before filing issues,

  1. could you post the issues in some form here or as a document?
  2. Alternatively, we have the Flang biweekly call this Wednesday and next Monday. You can present your findings in these calls. But I don’t know whether the time slot will be suitable for you. The call is generally at 4.30 pm BST.

Thank you for your comment.

First, I organize the results of the test set, create a list of errors, and post it. I think it will take about a few days.
After that, I would like to check the results of the test set and post issues.

1 Like

Thank you @ohno-fj!

I have posted a list of many “not yet implemented” messages here:

You may add to this list if you would like.

Semantic checking in Flang is not complete. Many constraints do not have checks yet. All bugs reports are welcome! A bug report with the constraint number would be great. We use the constraint numbers from the Fortran 2018 standard.

I am looking forward to your complete report. We want to fix all internal errors and prevent runtime errors in legal programs.

  • Steve
1 Like

Hello
Thank you for comment.

I made a list of errors. This list is based on flang’s message output.
Please let me know if you need additional information.
The flang I used for the compilation and execution is the main branch built on June 28, 2022.

However, when I tried to upload the file, the following message was output.
Sorry, new users can not upload attachments.

I cannot upload it, so I will paste the list I created below.

  • Compilation Error: “not yet implemented:” (constraint number and error description)

    • %VAL() intrinsic for arguments
    • Atomic update & capture
      32 BOZ
    • OpenMP Block construct clauses
      40 RANDOM_NUMBER(): REAL kind 16
    • REAL/COMPLEX(KIND=16)
    • Unhandled block directive
      38 VOLATILE in procedure interface
      15 allocatable component in structure constructor
      9 allocatable components in derived type assignment
      10 assumed length character allocatable
      47 auto boxing of a ranked expression on RHS for pointer assignment
      11 character array expression temp with dynamic length
      46 complex for this precision
      27 deep copy on allocatable members
    • intrinsic: abort
    • intrinsic: get_command
    • intrinsic: loc
    • intrinsic: move_alloc
    • intrinsic: selected_int_kind
    • intrinsic: selected_real_kind
    • intrinsic: shape
    • lowering derived type components with non default lower bounds
      52 non elemental user defined array assignment inside FORALL
      19 passing dynamically optional argument to elemental procedures
    • structure constructor
    • support for UNION
    • unhandled array constructor expression
    • unhandled dynamically optional arguments in SYSTEM_CLOCK or RANDOM_SEED
  • Compilation Error: “TODO:” (error description)
    no math runtime available for ‘abs(f128)’
    no math runtime available for ‘cos(!fir.complex<16>)’
    no math runtime available for ‘cos(f128)’
    no math runtime available for ‘exp(f128)’
    no math runtime available for ‘f128 ** i32’
    no math runtime available for ‘f128 ** i64’
    no math runtime available for ‘floor(f128)’
    no math runtime available for ‘hypot(f128, f128)’
    no math runtime available for ‘sqrt(f128)’

  • compile error(error description)
    ‘acefcn’ was previously called as a function
    ‘ext_sub’ is already declared in this scoping unit
    ‘fir.convert’ op invalid type conversion
    ‘fir.result’ op must be the last operation in the parent block
    ‘fun’ is already declared in this scoping unit
    ‘gen1’ may not be the name of both a generic interface and a procedure unless it is a specific procedure of the generic ‘i’ is not an object that can appear in an expression
    ‘i’ is not an object that can appear in an expression
    ‘ifun05’ was previously called as a function
    ‘int’ not found in module ‘mod’
    ‘jfun1’ is already declared in this scoping unit
    ‘jjj’ not found in module ‘mod2a’
    ‘jjja’ not found in module ‘mod2a’
    ‘l6lxicrqtg0jsrv4prfygwi’ not found in module ‘xhcw9knwd’
    ‘n’ is not an object that can appear in an expression
    ‘n1’ is not an object that can appear in an expression
    ‘omp.single’ op region #0 (‘region’) failed to verify constraint: region with 1 blocks
    ‘target=’ argument has unacceptable rank 1
    ‘xd’ is not an object that can appear in an expression
    (semantics issue) no assigned goto targets
    A dummy procedure may not be ELEMENTAL
    A length specifier cannot be used to declare the non-character entity ‘b’
    ALLOCATABLE dummy argument ‘k=’ must be associated with an ALLOCATABLE actual argument
    Actual argument for ‘a=’ has bad type ‘INTEGER(4)’
    Actual argument for ‘string=’ has bad type ‘INTEGER(4)’
    Actual argument type ‘REAL(4)’ is not compatible with dummy argument type ‘INTEGER(4)’
    Actual procedure argument has interface incompatible with dummy argument ‘a=’
    An initialized variable in BLOCK DATA must be in a COMMON block
    Argument of ALLOCATED() must be an ALLOCATABLE object or component
    Array ‘yyy’ without ALLOCATABLE or POINTER attribute must have explicit shape
    Atomic update variable ‘a(i)’ not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct
    Atomic update variable ‘a(i)’ not found in the argument list of intrinsic procedure
    CYCLE construct-name is not in scope
    Cannot read module file for module ‘optparam’: Source file ‘optparam.mod’ was not found
    Cannot use-associate ‘araloc’; it is already declared in this scope
    Cannot use-associate ‘getstufffrommodule2’; it is already declared in this scope
    Cannot use-associate ‘jff’; it is already declared in this scope
    Cannot use-associate ‘sub1’; it is already declared in this scope
    Could not parse
    DATA statement value ‘real(z8000000000000000,kind=8)’ for ‘m0’ is not a constant
    DATA statement value could not be converted to the type ‘CHARACTER(KIND=1,LEN=8_8)’ of the object ‘name’
    DO controls should be INTEGER
    Default-initialized ‘i01’ must not be initialized in a DATA statement
    Derived type ‘ez7xvtz_xtk38ryfopuf0v1aihu’ not found
    Dimension 1 of initialized object has extent 5, but initialization expression has extent 3
    Dimension 1 of left operand has extent 2, but right operand has extent 4
    Dummy argument ‘c=’ (#3) is not OPTIONAL and is not associated with an actual argument in this procedure reference
    Duplicate UNIT specifier
    Duplicate UNIT specifier
    EXIT construct-name is not in scope
    Entity in ALLOCATE statement must have the ALLOCATABLE or POINTER attribute
    Expected ‘F’ edit descriptor ‘.d’ value
    Expected ‘F’ edit descriptor ‘d’ value after ‘.’
    Explicit initializations of equivalenced objects affect ‘b(1_8)’ more than once
    External I/O is not allowed in a pure subprogram
    Generic ‘a’ may not have specific procedures ‘a_1’ and ‘a_2’ as their interfaces are not distinguishable
    Generic spec ‘.doto.’ not found
    IMPLICIT statements must follow USE and IMPORT and precede all other declarations
    Implicit declaration of function ‘f2c’ has a different result type than in previous declaration
    Implicitly typed local entity ‘kk’ not allowed in specification expression
    Implied-shape array ‘ia’ must be a named constant or a dummy argument
    Incomplete character literal
    Initialization expression cannot be converted to declared type of ‘a1’
    Initialization expression for ‘b’ ([x::(x(xx=1_4)),(x(xx=2_4)),(x(xx=3_4)),(x(xx=4_4)),(x(xx=5_4))]) cannot be computed as a constant value
    Invalid ACTION value ‘both’
    Invalid CONVERT value ‘IBM’
    Invalid FORMAT: integer expected at ‘)’
    Invalid specification expression: reference to OPTIONAL dummy argument ‘d’
    LOGICAL operands must be compared using .EQV. or .NEQV.
    Multiple initialization of COMMON block /cmn/
    Must be a constant value
    Must be a scalar value, but is a rank-2 array
    Must have INTEGER type, but is REAL(4)
    No explicit type declared for ‘imag’
    No intrinsic or user-defined ASSIGNMENT(=) matches operand types INTEGER(4) and CHARACTER(KIND=1)
    Operands of - are not conformable; have rank 4 and rank 1
    Operands of .EQ. must have comparable types; have INTEGER(4) and LOGICAL(4)
    Operands of .NE. are not conformable; have rank 4 and rank 1
    Recursive call to ‘is1’ requires a distinct RESULT in its declaration
    References to the procedure ‘d7tpr’ require an explicit interface
    Result of ENTRY is not compatible with result of containing function
    Subscript value (-1) is out of range on dimension 1 in reference to a constant array value
    The DEFAULT(NONE) clause requires that ‘lim’ must be listed in a data-sharing attribute clause
    The DEFAULT(NONE) clause requires that ‘lim’ must be listed in a data-sharing attribute clause
    The type of ‘i’ has already been implicitly declared
    The type of ‘n1’ has already been declared
    Type of Cray pointee ‘vp’ is a non-sequence derived type
    Unexpected ‘<’ in format expression
    Unimplemented CARRIAGECONTROL value ‘fortran’
    Values in array constructor must have the same declared type when no explicit type appears
    Variable ‘a’ with TARGET attribute is not allowed in an equivalence set
    bad character (‘') in Fortran token
    fatal Fortran runtime error
    operand #0 does not dominate this use
    operand #1 does not dominate this use
    operand #3 does not dominate this use
    operands must be INTEGER or REAL
    redefinition of symbol named ‘_FortranADestroy’
    substring of static array object
    symbol is not a dummy in this call
    symbol is not mapped to any IR value
    type of return operand 0 (’!fir.array<?x!fir.char<1,0>>') doesn't match function result type ('!fir.array<?x!fir.char<1,?>>‘) in function @_QMm8Pf1
    type parameter definitions must appear before component declarations
    unknown keyword argument to intrinsic ‘new_line’
    unsigned int mlir::Type::getIntOrFloatBitWidth() const
    unhandled type in fir.box code generation
    ArrayExprLowering::lowerAllocatableArrayAssignment(const SomeExpr&, const SomeExpr&): Assertion
    ArrayExprLowering::lowerAllocatableArrayAssignment(const SomeExpr&, const SomeExpr&): Assertion
    Assertion eleBoxTy && eleBoxTy.isa<fir::BoxType>()' failed. Assertion eleBoxTy && eleBoxTy.isafir::BoxType()’ failed.
    Assertion `resultRank[0] != fir::SequenceType::getUnknownExtent() && “shape arg must have constant size”’ failed.
    Fortran::lower::StatementContext::~StatementContext(): Assertion
    bool mlir::Type::isa() const [with U = fir::CharacterType]: Assertion
    llvm::APFloat::APFloat(const llvm::fltSemantics&, llvm::StringRef): Assertion
    unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion
    void {anonymous}::ArrayExprLowering::lowerAllocatableArrayAssignment(const SomeExpr&, const SomeExpr&): Assertion

  • compile error(excerpt of the program in the error message)
    !$OMP END SINGLE COPYPRIVATE (a,b,x,y) → error: COPYPRIVATE variable ‘a’ is not PRIVATE or THREADPRIVATE in outer context
    !$omp threadprivate(str,sss) → error: A variable that appears in a THREADPRIVATE directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly
    10 FORMAT (‘1’,X,‘OS/700 FORTRAN-A TEST’) → error: expected ‘)’
    102 format((i.)) → error: expected ‘)’
    111 FORMAT (A1) → error: expected ‘)’
    150 FORMAT(F0) ! ITTEM1??IWRITEE,??C>>EIN → error: expected ‘=’ / >> is a double-byte character.
    1format(1h ,E20.6D4) → error: expected ‘)’
    504 FORMAT(3Q15.7) → error: expected ‘:’
    CALL EXP ( &10) → error: Unmatched ‘(’
    EMK5GUSI9F9V.XHI=-5.0E-21 → error: expected ‘=>’
    INQUIRE( unit=1, FLEN=fs) → error: expected ‘=’
    INTEGER FUNCTION CHECK4(X) → error: expected ‘(’
    IQW2R5G3APQ.LBHUO=PB_31 → error: expected ‘=>’
    LOGICAL LA1
    1(2,2) → error: expected ‘(’
    MLVFPA:IF ( VC(56)%TRN.AND…TRUE…OR.(+33).LE.(M(96,1)%J) ) THEN → error: expected ‘FORALL’
    RECORD /O_CALC/ O(1:1_1,-83_4:-83) → error: Derived type ‘/o_calc/’ not found
    USE HSL_AD01_FORWARD_DOUBLE
    XVPLK1WQZMZ89YG(1,1)%Z=L(1,1).Z → error: expected execution part construct
    ans=associated(i,null()) → error: ‘target=’ argument has unacceptable rank 0
    automatic → error: expected ‘(’
    call chkxs( chks(null(xs3(3)) )) → error: MOLD= argument to NULL() must be a pointer or allocatable
    call move_alloc(from,to)
    call s2(int(z’0000 0000 0000 0001’,kind=8),1)
    call sub01(struct01%struct02(1)%int02)
    cha=new_line(A=cha(arr)(1:1)) → error: Actual argument associated with INTENT(IN OUT) dummy argument ‘from=’ must be definable
    changeentry st01 → error: expected declaration construct
    character21 iaa → error: The type of ‘iaa’ has already been implicitly declared
    character
    4,pointer ::b(:),c5(:slight_smile: → error: expected ‘(’
    common /com/ str1,str2,str3,str4 → error: Derived type variable ‘str1’ may not appear in a COMMON block due to component with default initialization
    common /com/ ia(10) → error: ‘ia’ cannot backward-extend COMMON block /com/ via EQUIVALENCE with ‘i1’
    common /com03/ ia(10),ib(10),ic(10) → error: ‘ib’ is storage associated with ‘ia’ by EQUIVALENCE elsewhere in COMMON block /com03/
    common /com06/ aaa,str → error: Multiple initialization of COMMON block /com06/
    common /com1/ a,k → error: ‘k’ is storage associated with ‘b’ by EQUIVALENCE elsewhere in COMMON block /com1/
    data c(1) /Zaffeebbe/ → error: DATA statement value ‘int(zaffeebbe,kind=4)’ for ‘c(1_8)’ is not a constant
    data str1,str2,str3,str4 /4
    ty1(3,4)/ → error: Default-initialized ‘str1’ must not be initialized in a DATA statement
    decode (4,1,i) j → error: expected ‘=>’
    definefile 10(10,10,E,i) → error: expected ‘(’
    do until(size((/(m,m=1,mm)/))==n) → error: expected ‘=>’
    end do → error: expected end of statement
    end for all → error: expected ‘END FORALL’
    entry ent(i) result(ib) → error: Result of ENTRY is not compatible with result of containing function
    entry isub01(ipp) → error: ‘isub01’ is already declared in this scoping unit
    equivalence (az1(1),az2(1,1)) → error: Reference to rank-2 object ‘az1’ has 1 subscripts
    equivalence(it1,it2) → error: Variable ‘it1’ with TARGET attribute is not allowed in an equivalence set
    error: ‘char’ is not an unrestricted specific intrinsic procedure
    union → error: expected component definition
    find(1,rec=2) → error: expected ‘=’
    if (0.eq.1) inquire(6,file=‘aaaa’,iostat=i) → error: If FILE appears, UNIT must not appear
    if(any(bl1/=(/.true._1,.true._1,.true._1/))) print ,‘err’ → error: LOGICAL operands must be compared using .EQV. or .NEQV.
    integer :: a01=z2 → error: Must be a constant value
    integer :: aler → error: expected ‘FORALL’
    integer :: arr(1,30,30,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30) → error: ‘arr’ has rank 30, which is greater than the maximum supported rank 15
    integer function fun1() result(res) → error: VOLATILE attribute may apply only to a variable
    integer ia(max(i,1_1),iabs(i)) → error: Actual argument for ‘a=’ has bad type or kind ‘INTEGER(8)’
    integer ii(ifun_integer_4(size(shape(a)))) → error: Implicitly typed local entity ‘a’ not allowed in specification expression
    integer v(100),vv
    8(41:42) → error: expected ‘(’
    integer(4),automatic::a(100,5) → error: expected ‘)’
    integer*(8),parameter::i1=1 → error: expected ‘(’
    integer1 , parameter ::jjjj = lrshft(p1,p2) → error: Must be a constant value
    integer
    2,parameter::i=lrshft(j,0) → error: Must be a constant value
    integer,allocatable:: x(:slight_smile: → error: expected ‘=>’
    integer,automatic:: a1,a2(2) → error: expected ‘(’
    integer,volatile :: m6 → error: The type of ‘m6’ has already been declared
    interface a → error: ‘a’ is already declared in this scoping unit
    interface assignment(=) → error: Generic ‘assignment(=)’ may not have specific procedures ‘ifun’ and ‘jfun’ as their interfaces are not distinguishable
    internal: expected a memory reference type ‘i32’
    intrinsic int1,jfix → error: ‘int1’ is not a known intrinsic procedure
    logical(kind=8) :: a01=B’1’ → error: Initialization expression cannot be converted to declared type of ‘a01’
    module mod4567890123456789012345678901234567890 & !40E,>>IU → error: expected ‘(’ / >> is a double-byte character.
    integer i1(n1(1)) → n1’ is not an object that can appear in an expression
    n1=lqf(n1,1) → error: Cannot call subroutine ‘lqf’ like a function
    open(1,blocksize=10000) → error: expected ‘)’
    parameter (i001=i2abs(-2_2)) → error: Must be a constant value
    parameter (j=z80000000) → error: Must be a constant value
    pointer (iwww,www) → error: Type of Cray pointee ‘www’ is a non-sequence derived type
    read(k,) (a,b) → error: expected execution part construct
    record /a1/ av → error: /a1/ is not a known STRUCTURE
    static :: iii → error: expected ‘(’
    static x → error: expected ‘(’
    struct01%struct02(1)%char02 = “0” → error: Left-hand side of assignment is not modifiable
    subroutine dsp_root(sub,icon) → No explicit type declared for ‘sub’
    type(b),allocatable::v1(:,:,:),v2(:,:,:slight_smile: → error: expected ‘=>’
    type(yy)::v03 → error: Derived type ‘yy’ not found
    undefined reference to __fc_cos_1' undefined reference to __fd_atan2_1’
    undefined reference to __fd_cos_1' undefined reference to __fd_exp_1’
    undefined reference to __fd_mod_1' undefined reference to __fd_pow_1’
    undefined reference to __fd_powi_1' undefined reference to _fd_sin_1’
    undefined reference to __fs_log10_1' undefined reference to fs_log_1’
    undefined reference to __fs_pow_1' undefined reference to fs_powi_1’
    undefined reference to __fs_tan_1' undefined reference to mth_i_dhypot’
    undefined reference to __mth_i_dsqrt' undefined reference to mth_i_hypot’
    undefined reference to __mth_i_ipowi' -> 10**j j:integer(4) undefined reference to mth_i_kpowk’ → 2**j j:integer(8)
    undefined reference to __mth_i_sqrt' undefined reference to clock

    undefined reference to clockm_' -> Fujitsu Specific Features undefined reference to etime

    undefined reference to fdate_' undefined reference to fgetc

    undefined reference to getcl_' undefined reference to getfd

    undefined reference to gettod_' -> Fujitsu Specific Features undefined reference to imag

    undefined reference to ishc_' undefined reference to itime

    undefined reference to izext2_' undefined reference to malloc

    undefined reference to qext_' undefined reference to qnint

    undefined reference to rand_' undefined reference to rindex

    undefined reference to secnds_' undefined reference to time
    ’ → Fujitsu Specific Features
    undefined reference to `timer
    ’ → Fujitsu Specific Features
    union → error: expected component definition
    use ::mod0 ,only : operator(.vvv.) => operator(.ccc.) → error: Generic ‘OPERATOR(.vvv.)’ may not have specific procedures ‘ifun’ and ‘ifun1’ as their interfaces are not distinguishable
    subroutine sub → error: VOLATILE attribute may apply only to a variable
    volatile :: /com/ → error: expected ‘(’
    write(1’2,3) 1 → error: Unmatched ‘(’
    write(1,‘(d15)’) 1.23456789 → error: Expected ‘D’ edit descriptor ‘.d’ value
    write(1,
    ) (i,3,4) → error: expected execution part construct
    write(1,)aa(1).wza(1).za → error: expected execution part construct
    write(8,
    )(1,r=1,10) → error: Must have INTEGER type, but is REAL(4)

  • internal error(error message)
    fatal internal error: CHECK(exprAnalyzer_.context().AnyFatalError()) failed at /…/LLVM14.0.6/llvm-project-main/flang/lib/Semantics/data-to-inits.cpp(354)
    fatal internal error: CHECK(!type_) failed at /…/LLVM14.0.6/llvm-project-main/flang/lib/Semantics/symbol.cpp(132)
    fatal internal error: CHECK(rightIter != rightArrConst.end()) failed at /…/LLVM14.0.6/llvm-project-main/flang/lib/Evaluate/fold-implementation.h(1386)

Thanks @ohno-fj for the list of errors. This is very helpful.

A few first comments,

  1. A few entries seem to have lost formatting. Could you check? For e.g, not sure whether the alignment of the following entries are correct.
OpenMP Block construct clauses
 40 RANDOM_NUMBER(): REAL kind 16
REAL/COMPLEX(KIND=16)
Unhandled block directive
  1. Looking at the message, failed at /…/LLVM14.0.6/llvm-project-main/flang/lib/Evaluate/fold-implementation.h, it seems that the test was conducted with LLVM 14.0.6. Is that correct or is that just a name for the directory? When reporting errors it will be good to test with the main development branch of LLVM with a reference to the commit at HEAD. Otherwise there is a possibility that the issue was fixed. For e.g. the abort intrinsic was added in ⚙ D130439 [flang] Support extention intrinsic ABORT by @PeixinQiao, the dynamically optional arguments in SYSTEM_CLOCK or RANDOM_SEED was fixed in ⚙ D131461 [flang] Intrinsic RANDOM_SEED calls with dynamically absent/present arguments by @vdonaldson.
  2. If the internal errors can be reproduced with main then please file tickets for that right away.
  3. It will be good to separate the OpenMP issues from the non-OpenMP ones.
  4. Undefined references to math functions like undefined reference to __fc_cos_1. In some cases we use the pgmath external library, but for most cases we recently removed the requirement. Could you post a reproducer for the issue here for a quick check?

Hi, I’m a colleague of @ohno-fj. It’s COB in Japan and he seems to have left the office.

The Discourse notification mail has the raw text:

- Compilation Error: "not yet implemented:" (constraint number and error description)  
   -  %VAL() intrinsic for arguments  
   -  Atomic update & capture  
  32  BOZ  
   -  OpenMP Block construct clauses  
  40  RANDOM_NUMBER(): REAL kind 16  
   -  REAL/COMPLEX(KIND=16)  
   -  Unhandled block directive  
  38  VOLATILE in procedure interface  
  15  allocatable component in structure constructor  
   9  allocatable components in derived type assignment  
  10  assumed length character allocatable  
  47  auto boxing of a ranked expression on RHS for pointer assignment  
  11  character array expression temp with dynamic length  
  46  complex for this precision  
  27  deep copy on allocatable members  
   -  intrinsic: abort  
   -  intrinsic: get_command  
   -  intrinsic: loc  
   -   intrinsic: move_alloc  
   -  intrinsic: selected_int_kind  
   -  intrinsic: selected_real_kind  
   -  intrinsic: shape  
   -  lowering derived type components with non default lower bounds  
  52  non elemental user defined array assignment inside FORALL  
  19  passing dynamically optional argument to elemental procedures  
   -  structure constructor  
   -  support for UNION  
   -  unhandled array constructor expression  
   -  unhandled dynamically optional arguments in SYSTEM_CLOCK or RANDOM_SEED  
  
  
- Compilation Error: "TODO:" (error description)  
  no math runtime available for 'abs(f128)'  
  no math runtime available for 'cos(!fir.complex<16>)'  
  no math runtime available for 'cos(f128)'  
  no math runtime available for 'exp(f128)'  
  no math runtime available for 'f128 ** i32'  
  no math runtime available for 'f128 ** i64'  
  no math runtime available for 'floor(f128)'  
  no math runtime available for 'hypot(f128, f128)'  
  no math runtime available for 'sqrt(f128)'  
  
  
- compile error(error description)  
  'acefcn' was previously called as a function  
  'ext_sub' is already declared in this scoping unit  
  'fir.convert' op invalid type conversion  
  'fir.result' op must be the last operation in the parent block  
  'fun' is already declared in this scoping unit  
  'gen1' may not be the name of both a generic interface and a procedure unless it is a specific procedure of the generic 'i' is not an object that can appear in an expression  
  'i' is not an object that can appear in an expression  
  'ifun05' was previously called as a function  
  'int' not found in module 'mod'  
  'jfun1' is already declared in this scoping unit  
  'jjj' not found in module 'mod2a'  
  'jjja' not found in module 'mod2a'  
  'l6lxicrqtg0jsrv4prfygwi' not found in module 'xhcw9knwd'  
  'n' is not an object that can appear in an expression  
  'n1' is not an object that can appear in an expression  
  'omp.single' op region #0 ('region') failed to verify constraint: region with 1 blocks  
  'target=' argument has unacceptable rank 1  
  'xd' is not an object that can appear in an expression  
  (semantics issue) no assigned goto targets  
  A dummy procedure may not be ELEMENTAL  
  A length specifier cannot be used to declare the non-character entity 'b'  
  ALLOCATABLE dummy argument 'k=' must be associated with an ALLOCATABLE actual argument  
  Actual argument for 'a=' has bad type 'INTEGER(4)'  
  Actual argument for 'string=' has bad type 'INTEGER(4)'  
  Actual argument type 'REAL(4)' is not compatible with dummy argument type 'INTEGER(4)'  
  Actual procedure argument has interface incompatible with dummy argument 'a='  
  An initialized variable in BLOCK DATA must be in a COMMON block  
  Argument of ALLOCATED() must be an ALLOCATABLE object or component  
  Array 'yyy' without ALLOCATABLE or POINTER attribute must have explicit shape  
  Atomic update variable 'a(i)' not found in the RHS of the assignment statement in an ATOMIC (UPDATE) construct  
  Atomic update variable 'a(i)' not found in the argument list of intrinsic procedure  
  CYCLE construct-name is not in scope  
  Cannot read module file for module 'optparam': Source file 'optparam.mod' was not found  
  Cannot use-associate 'araloc'; it is already declared in this scope  
  Cannot use-associate 'getstufffrommodule2'; it is already declared in this scope  
  Cannot use-associate 'jff'; it is already declared in this scope  
  Cannot use-associate 'sub1'; it is already declared in this scope  
  Could not parse  
  DATA statement value 'real(z8000000000000000,kind=8)' for 'm0' is not a constant  
  DATA statement value could not be converted to the type 'CHARACTER(KIND=1,LEN=8_8)' of the object 'name'  
  DO controls should be INTEGER  
  Default-initialized 'i01' must not be initialized in a DATA statement  
  Derived type 'ez7xvtz_xtk38ryfopuf0v1aihu' not found  
  Dimension 1 of initialized object has extent 5, but initialization expression has extent 3  
  Dimension 1 of left operand has extent 2, but right operand has extent 4  
  Dummy argument 'c=' (#3) is not OPTIONAL and is not associated with an actual argument in this procedure reference  
  Duplicate UNIT specifier  
  Duplicate UNIT specifier  
  EXIT construct-name is not in scope  
  Entity in ALLOCATE statement must have the ALLOCATABLE or POINTER attribute  
  Expected 'F' edit descriptor '.d' value  
  Expected 'F' edit descriptor 'd' value after '.'  
  Explicit initializations of equivalenced objects affect 'b(1_8)' more than once  
  External I/O is not allowed in a pure subprogram  
  Generic 'a' may not have specific procedures 'a_1' and 'a_2' as their interfaces are not distinguishable  
  Generic spec '.doto.' not found  
  IMPLICIT statements must follow USE and IMPORT and precede all other declarations  
  Implicit declaration of function 'f2c' has a different result type than in previous declaration  
  Implicitly typed local entity 'kk' not allowed in specification expression  
  Implied-shape array 'ia' must be a named constant or a dummy argument  
  Incomplete character literal  
  Initialization expression cannot be converted to declared type of 'a1'  
  Initialization expression for 'b' ([x::(x(xx=1_4)),(x(xx=2_4)),(x(xx=3_4)),(x(xx=4_4)),(x(xx=5_4))]) cannot be computed as a constant value  
  Invalid ACTION value 'both'  
  Invalid CONVERT value 'IBM'  
  Invalid FORMAT: integer expected at ')'  
  Invalid specification expression: reference to OPTIONAL dummy argument 'd'  
  LOGICAL operands must be compared using .EQV. or .NEQV.  
  Multiple initialization of COMMON block /cmn/  
  Must be a constant value  
  Must be a scalar value, but is a rank-2 array  
  Must have INTEGER type, but is REAL(4)  
  No explicit type declared for 'imag'  
  No intrinsic or user-defined ASSIGNMENT(=) matches operand types INTEGER(4) and CHARACTER(KIND=1)  
  Operands of - are not conformable; have rank 4 and rank 1  
  Operands of .EQ. must have comparable types; have INTEGER(4) and LOGICAL(4)  
  Operands of .NE. are not conformable; have rank 4 and rank 1  
  Recursive call to 'is1' requires a distinct RESULT in its declaration  
  References to the procedure 'd7tpr' require an explicit interface  
  Result of ENTRY is not compatible with result of containing function  
  Subscript value (-1) is out of range on dimension 1 in reference to a constant array value  
  The DEFAULT(NONE) clause requires that 'lim' must be listed in a data-sharing attribute clause  
  The DEFAULT(NONE) clause requires that 'lim' must be listed in a data-sharing attribute clause  
  The type of 'i' has already been implicitly declared  
  The type of 'n1' has already been declared  
  Type of Cray pointee 'vp' is a non-sequence derived type  
  Unexpected '<' in format expression  
  Unimplemented CARRIAGECONTROL value 'fortran'  
  Values in array constructor must have the same declared type when no explicit type appears  
  Variable 'a' with TARGET attribute is not allowed in an equivalence set  
  bad character ('\') in Fortran token  
  fatal Fortran runtime error  
  operand #0 does not dominate this use  
  operand #1 does not dominate this use  
  operand #3 does not dominate this use  
  operands must be INTEGER or REAL  
  redefinition of symbol named '_FortranADestroy'  
  substring of static array object  
  symbol is not a dummy in this call  
  symbol is not mapped to any IR value  
  type of return operand 0 ('!fir.array<?x!fir.char<1,0>>') doesn't match function result type ('!fir.array<?x!fir.char<1,?>>') in function @_QMm8Pf1  
  type parameter definitions must appear before component declarations  
  unknown keyword argument to intrinsic 'new_line'  
  unsigned int mlir::Type::getIntOrFloatBitWidth() const  
  unhandled type in fir.box code generation  
  ArrayExprLowering::lowerAllocatableArrayAssignment(const SomeExpr&, const SomeExpr&): Assertion  
  ArrayExprLowering::lowerAllocatableArrayAssignment(const SomeExpr&, const SomeExpr&): Assertion  
  Assertion `eleBoxTy && eleBoxTy.isa<fir::BoxType>()' failed.  
  Assertion `eleBoxTy && eleBoxTy.isa<fir::BoxType>()' failed.  
  Assertion `resultRank[0] != fir::SequenceType::getUnknownExtent() && "shape arg must have constant size"' failed.  
  Fortran::lower::StatementContext::~StatementContext(): Assertion  
  bool mlir::Type::isa() const [with U = fir::CharacterType]: Assertion  
  llvm::APFloat::APFloat(const llvm::fltSemantics&, llvm::StringRef): Assertion  
  unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion  
  void {anonymous}::ArrayExprLowering::lowerAllocatableArrayAssignment(const SomeExpr&, const SomeExpr&): Assertion  
  
  
- compile error(excerpt of the program in the error message)  
  !$OMP END SINGLE COPYPRIVATE (a,b,x,y) -> error: COPYPRIVATE variable 'a' is not PRIVATE or THREADPRIVATE in outer context  
  !$omp threadprivate(str,sss) -> error: A variable that appears in a THREADPRIVATE directive must be declared in the scope of a module or have the SAVE attribute, either explicitly or implicitly  
  10 FORMAT ('1',<i5>X,'OS/700 FORTRAN-A TEST') -> error: expected ')'  
  102 format((<k>i<j>.<jj>)) -> error: expected ')'  
  111   FORMAT (<NL>A1) -> error: expected ')'  
  150 FORMAT(F0)      ! ITTEM1??IWRITEE,??C>>EIN  -> error: expected '='  / >> is a double-byte character.  
  1format(1h ,E20.6D4) -> error: expected ')'  
  504  FORMAT(3Q15.7) -> error: expected ':'  
  CALL EXP ( &10) -> error: Unmatched '('  
  EMK5GUSI9F9V.XHI=-5.0E-21 -> error: expected '=>'  
  INQUIRE( unit=1, FLEN=fs) -> error: expected '='  
  INTEGER FUNCTION CHECK*4(X) -> error: expected '('  
  IQW2R5G3APQ.LBHUO=PB_31 -> error: expected '=>'  
  LOGICAL LA1*1(2,2) -> error: expected '('  
  MLVFPA:IF ( VC(56)%TRN.AND..TRUE..OR.(+33).LE.(M(96,1)%J) ) THEN -> error: expected 'FORALL'  
  RECORD /O_CALC/ O(1:1_1,-83_4:-83) -> error: Derived type '/o_calc/' not found  
  USE HSL_AD01_FORWARD_DOUBLE  
  XVPLK1WQZMZ89YG(1,1)%Z=L(1,1).Z -> error: expected execution part construct  
  ans=associated(i,null()) -> error: 'target=' argument has unacceptable rank 0  
  automatic -> error: expected '('  
  call chkxs( chks(null(xs3(3)) )) -> error: MOLD= argument to NULL() must be a pointer or allocatable  
  call move_alloc(from,to)  
  call s2(int(z'0000 0000 0000 0001',kind=8),1)  
  call sub01(struct01%struct02(1)%int02)  
  cha=new_line(A=cha(arr)(1:1)) -> error: Actual argument associated with INTENT(IN OUT) dummy argument 'from=' must be definable  
  changeentry st01 -> error: expected declaration construct  
  character*21 iaa -> error: The type of 'iaa' has already been implicitly declared  
  character*4,pointer ::b(:),c*5(:) -> error: expected '('  
  common /com/  str1,str2,str3,str4 -> error: Derived type variable 'str1' may not appear in a COMMON block due to component with default initialization  
  common /com/ ia(10) -> error: 'ia' cannot backward-extend COMMON block /com/ via EQUIVALENCE with 'i1'  
  common /com03/ ia(10),ib(10),ic(10) -> error: 'ib' is storage associated with 'ia' by EQUIVALENCE elsewhere in COMMON block /com03/  
  common /com06/ aaa,str -> error: Multiple initialization of COMMON block /com06/  
  common /com1/  a,k -> error: 'k' is storage associated with 'b' by EQUIVALENCE elsewhere in COMMON block /com1/  
  data c(1) /Zaffeebbe/ -> error: DATA statement value 'int(zaffeebbe,kind=4)' for 'c(1_8)' is not a constant  
  data str1,str2,str3,str4 /4*ty1(3,4)/ -> error: Default-initialized 'str1' must not be initialized in a DATA statement  
  decode (4,1,i) j -> error: expected '=>'  
  definefile 10(10,10,E,i) -> error: expected '('  
  do until(size((/(m,m=1,mm)/))==n) -> error: expected '=>'  
  end do -> error: expected end of statement  
  end for all -> error: expected 'END FORALL'  
  entry ent(i) result(ib) -> error: Result of ENTRY is not compatible with result of containing function  
  entry isub01(ipp) -> error: 'isub01' is already declared in this scoping unit  
  equivalence (az1(1),az2(1,1)) -> error: Reference to rank-2 object 'az1' has 1 subscripts  
  equivalence(it1,it2) -> error: Variable 'it1' with TARGET attribute is not allowed in an equivalence set  
  error: 'char' is not an unrestricted specific intrinsic procedure  
  union -> error: expected component definition  
  find(1,rec=2) -> error: expected '='  
  if (0.eq.1) inquire(6,file='aaaa',iostat=i) -> error: If FILE appears, UNIT must not appear  
  if(any(bl1/=(/.true._1,.true._1,.true._1/))) print *,'err' -> error: LOGICAL operands must be compared using .EQV. or .NEQV.  
  integer :: a01=z2 -> error: Must be a constant value  
  integer :: aler -> error: expected 'FORALL'  
  integer :: arr(1,30,30,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30) -> error: 'arr' has rank 30, which is greater than the maximum supported rank 15  
  integer function fun1() result(res) -> error: VOLATILE attribute may apply only to a variable  
  integer ia(max(i,1_1),iabs(i)) -> error: Actual argument for 'a=' has bad type or kind 'INTEGER(8)'  
  integer ii(ifun_integer_4(size(shape(a)))) -> error: Implicitly typed local entity 'a' not allowed in specification expression  
  integer v(100),vv*8(41:42) -> error: expected '('  
  integer(4),automatic::a(100,5) -> error: expected ')'  
  integer*(8),parameter::i1=1 -> error: expected '('  
  integer*1 , parameter ::jjjj = lrshft(p1,p2) -> error: Must be a constant value  
  integer*2,parameter::i=lrshft(j,0) -> error: Must be a constant value  
  integer,allocatable:: x(:) -> error: expected '=>'  
  integer,automatic:: a1,a2(2) -> error: expected '('  
  integer,volatile :: m6 -> error: The type of 'm6' has already been declared  
  interface a -> error: 'a' is already declared in this scoping unit  
  interface assignment(=) -> error: Generic 'assignment(=)' may not have specific procedures 'ifun' and 'jfun' as their interfaces are not distinguishable  
  internal: expected a memory reference type 'i32'  
  intrinsic int1,jfix -> error: 'int1' is not a known intrinsic procedure  
  logical(kind=8) :: a01=B'1' -> error: Initialization expression cannot be converted to declared type of 'a01'  
  module mod4567890123456789012345678901234567890 & !40E,>>IU  -> error: expected '('  / >> is a double-byte character.
  integer i1(n1(1)) -> n1' is not an object that can appear in an expression  
  n1=lqf(n1,1) -> error: Cannot call subroutine 'lqf' like a function  
  open(1,blocksize=10000) -> error: expected ')'  
  parameter (i001=i2abs(-2_2)) -> error: Must be a constant value  
  parameter (j=z80000000) -> error: Must be a constant value  
  pointer (iwww,www) -> error: Type of Cray pointee 'www' is a non-sequence derived type  
  read(k,*) (a,b) -> error: expected execution part construct  
  record /a1/ av -> error: /a1/ is not a known STRUCTURE  
  static :: iii -> error: expected '('  
  static x -> error: expected '('  
  struct01%struct02(1)%char02 = "0" -> error: Left-hand side of assignment is not modifiable  
  subroutine dsp_root(sub,icon) -> No explicit type declared for 'sub'  
  type(b),allocatable::v1(:,:,:),v2(:,:,:) -> error: expected '=>'  
  type(yy)::v03 -> error: Derived type 'yy' not found  
  undefined reference to `__fc_cos_1'  
  undefined reference to `__fd_atan2_1'  
  undefined reference to `__fd_cos_1'  
  undefined reference to `__fd_exp_1'  
  undefined reference to `__fd_mod_1'  
  undefined reference to `__fd_pow_1'  
  undefined reference to `__fd_powi_1'  
  undefined reference to `__fd_sin_1'  
  undefined reference to `__fs_log10_1'  
  undefined reference to `__fs_log_1'  
  undefined reference to `__fs_pow_1'  
  undefined reference to `__fs_powi_1'  
  undefined reference to `__fs_tan_1'  
  undefined reference to `__mth_i_dhypot'  
  undefined reference to `__mth_i_dsqrt'  
  undefined reference to `__mth_i_hypot'  
  undefined reference to `__mth_i_ipowi' -> 10**j j:integer(4)  
  undefined reference to `__mth_i_kpowk' -> 2**j j:integer(8)  
  undefined reference to `__mth_i_sqrt'  
  undefined reference to `clock_'  
  undefined reference to `clockm_'  -> Fujitsu Specific Features  
  undefined reference to `etime_'  
  undefined reference to `fdate_'  
  undefined reference to `fgetc_'  
  undefined reference to `getcl_'  
  undefined reference to `getfd_'  
  undefined reference to `gettod_'  -> Fujitsu Specific Features  
  undefined reference to `imag_'  
  undefined reference to `ishc_'  
  undefined reference to `itime_'  
  undefined reference to `izext2_'  
  undefined reference to `malloc_'  
  undefined reference to `qext_'  
  undefined reference to `qnint_'  
  undefined reference to `rand_'  
  undefined reference to `rindex_'  
  undefined reference to `secnds_'  
  undefined reference to `time_'  -> Fujitsu Specific Features  
  undefined reference to `timer_'  -> Fujitsu Specific Features  
  union -> error: expected component definition  
  use ::mod0 ,only : operator(.vvv.) => operator(.ccc.) -> error: Generic 'OPERATOR(.vvv.)' may not have specific procedures 'ifun' and 'ifun1' as their interfaces are not distinguishable  
  subroutine sub -> error: VOLATILE attribute may apply only to a variable  
  volatile :: /com/ -> error: expected '('  
  write(1'2,3) 1 -> error: Unmatched '('  
  write(1,'(d15)') 1.23456789 -> error: Expected 'D' edit descriptor '.d' value  
  write(1,*) (i,3,4) -> error: expected execution part construct  
  write(1,*)aa(1).wza(1).za -> error: expected execution part construct  
  write(8,*)(1,r=1,10) -> error: Must have INTEGER type, but is REAL(4)  
  
  
- internal error(error message)  
  fatal internal error: CHECK(exprAnalyzer_.context().AnyFatalError()) failed at /../LLVM14.0.6/llvm-project-main/flang/lib/Semantics/data-to-inits.cpp(354)  
  fatal internal error: CHECK(!type_) failed at /../LLVM14.0.6/llvm-project-main/flang/lib/Semantics/symbol.cpp(132)  
  fatal internal error: CHECK(rightIter != rightArrConst.end()) failed at /../LLVM14.0.6/llvm-project-main/flang/lib/Evaluate/fold-implementation.h(1386)
1 Like

For non-standard intrinsics, you can post a single ticket listing all of them.

  undefined reference to `clock_'  
  undefined reference to `etime_'  
  undefined reference to `fdate_'  
  undefined reference to `fgetc_'  
  undefined reference to `getcl_'  
  undefined reference to `getfd_'  
  undefined reference to `imag_'  
  undefined reference to `ishc_'  
  undefined reference to `itime_'  
  undefined reference to `izext2_'  
  undefined reference to `malloc_'  
  undefined reference to `qext_'  
  undefined reference to `qnint_'  
  undefined reference to `rand_'  
  undefined reference to `rindex_'  
  undefined reference to `secnds_'  

I guess Fujitsu specific features might have to to be downstream unless the community is also interested.

  undefined reference to `clockm_'  -> Fujitsu Specific Features  
  undefined reference to `gettod_'  -> Fujitsu Specific Features  
  undefined reference to `time_'  -> Fujitsu Specific Features  
  undefined reference to `timer_'  -> Fujitsu Specific Features 

Thank you @ohno-fj and @kawashima-fj.

What is the commit id of the compiler that you are using?

Hello

I downloaded the source as a zip file to Windows and transferred it to my Linux machine, so I didn’t know the commit ID.
The source I downloaded was from the main branch on June 28, 2022.

Thanks @ohno-fj.

I could be wrong here or there might be a misunderstanding. But I am assuming you downloaded the source from the Release page of LLVM, specifically you downloaded 14.0.6 from https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.6.

If this is what you used then I think quite a lot of fixes might have gone into Flang after this. Also a lot of code was upstreamed from the fir-dev branch after this. The top 3 commits in 14.0.6 for Flang that I see are dated to February as given below. Typically a minor release like 14.0.6 will only contain specific fixes that are picked into the 14.* release branch. For Flang we have not ported any of the fixes into 14.* release since Flang is not yet ready for users.

commit 3001b0d519630e2f1f0e2c4710379b3dbb43b715
Author: Rainer Orth <ro@gcc.gnu.org>
Date:   Thu Feb 10 16:09:50 2022 +0100
    [fir] Fix FlangOptimizerTests link on Solaris

commit 97fdb3a48aa849750378f01d4bcd0dc89c71b747
Author: Louis Dionne <ldionne.2@gmail.com>
Date:   Wed Feb 9 12:08:44 2022 -0500

    Update all LLVM documentation mentioning runtimes in LLVM_ENABLE_PROJECTS

commit db01b123d012df2f0e6acf7e90bf4ba63382587c
Author: Valentin Clement <clementval@gmail.com>
Date:   Wed Feb 2 08:15:26 2022 +0100

    [flang] Lower PAUSE statement

Since many of the issues that you see might have been fixed, it would be better to trim the list to avoid reporting fixed issues. I think there are two ways to proceed as given below. Would either of these work for you?

  1. Before reporting each issue that you currently have, test it against a latest build from main branch.
  2. Rerun the tests with the main branch and create a new list of issues.

You can build the main branch in the following way

git clone https://github.com/llvm/llvm-project.git
cd llvm-project
mkdir build
cd build
cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="mlir;flang;clang;openmp" -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON
ninja check-flang

Thanks @kiranchandramohan

The error list I reported this time seems that the flang I used was old. As a result, the test set resulted in many errors. A few days ago, I was able to successfully compile and execute several test sets in error using the latest flang.

I would like to compile and execute the test set again using the latest main branch (flang).
I make a list of errors for the test sets that are still in error using the latest flang.

1 Like

Hello, @kiranchandramohan

I got the main branch with the git clone command on October 20, 2022. Then I built and compiled and executed the test sets.

The “commit id” of flang I used is as follows.

  $ flang-new --version
  flang-new version 16.0.0 (https://github.com/llvm/llvm-project.git e0fb01e97b6b7d2fe66b17b36eeb98aa78c6e3bb)

Below is the list of errors again. Fujitsu specific features were excluded. I can’t post the file, so I paste the text.

As a next step, I will check the cause of the test set that failed. Also, I would like to post an issue based on the many advice I received here.

- Compilation Error: "not yet implemented:"
  The number at the beginning of each line is the number "Item #".
  "**" did not have a corresponding number for "Item #".

  ** not yet implemented: %VAL() intrinsic for arguments
  32 not yet implemented: BOZ
  38 not yet implemented: VOLATILE in procedure interface
  15 not yet implemented: allocatable component in structure constructor
   9 not yet implemented: allocatable components in derived type assignment
  ** not yet implemented: assignment in a FORALL involving a designator with a POINTER or ALLOCATABLE component part-ref
  ** not yet implemented: assignment to whole allocatable array inside FORALL
  10 not yet implemented: assumed length character allocatable
  47 not yet implemented: auto boxing of a ranked expression on RHS for pointer assignment
  11 not yet implemented: character array expression temp with dynamic length
  46 not yet implemented: complex for this precision
  45 not yet implemented: creating an array temp where the element type has allocatable members
  27 not yet implemented: deep copy on allocatable members
  14 not yet implemented: derived type components with non default lower bounds
  ** not yet implemented: intrinsic: get_command
  ** not yet implemented: intrinsic: loc
  ** not yet implemented: intrinsic: move_alloc
  ** not yet implemented: intrinsic: pow
  ** not yet implemented: intrinsic: shape
  ** not yet implemented: loading polymorphic or assumed rank fir.box
  ** not yet implemented: lowering derived type components with non default lower bounds
  ** not yet implemented: no math runtime available for 'abs(!fir.complex<16>)'
  ** not yet implemented: no math runtime available for 'cos(f128)'
  ** not yet implemented: no math runtime available for 'exp(f128)'
  ** not yet implemented: no math runtime available for 'f128 ** i32'
  ** not yet implemented: no math runtime available for 'floor(f128)'
  ** not yet implemented: no math runtime available for 'sqrt(f128)'
  52 not yet implemented: non elemental user defined array assignment inside FORALL
  19 not yet implemented: passing dynamically optional argument to elemental procedures
  ** not yet implemented: structure constructor
  ** not yet implemented: support for UNION
  ** not yet implemented: unhandled array constructor expression


- compile error
  undefined reference to `__fc_pow_1',
  undefined reference to `__fc_powi_1'
  undefined reference to `__mth_i_hypot'
  undefined reference to `__mth_i_ipowi'
  undefined reference to `ctime_'
  undefined reference to `date_'
  undefined reference to `derfc_'
  undefined reference to `error_'
  undefined reference to `etime_'
  undefined reference to `fdate_'
  undefined reference to `fgetc_'
  undefined reference to `free_'
  undefined reference to `getcl_'
  undefined reference to `getfd_'
  undefined reference to `ishc_'
  undefined reference to `itime_'
  undefined reference to `izext2_'
  undefined reference to `jdate_'
  undefined reference to `jzext4_'
  undefined reference to `lnblnk_'
  undefined reference to `ltime_'
  undefined reference to `malloc_'
  undefined reference to `qabs_',
  undefined reference to `qcmplx_'
  undefined reference to `qext_'
  undefined reference to `qnint_'
  undefined reference to `rand_'
  undefined reference to `rindex_'
  undefined reference to `secnds_'
  undefined reference to `system_'
  'fir.absent' op result #0 must be any reference or box like, but got 'tuple<!fir.boxproc<() -> ()>, i64>'
  'fir.convert' op invalid type conversion
  'fir.result' op must be the last operation in the parent block
  Actual argument associated with INTENT(IN OUT) dummy argument 'from=' must be definable / call move_alloc(from,to)
  Expected 'D' edit descriptor '.d' value / write(1,'(d15)') 1.23456789
  Implicit declaration of function 'jfunc02' has a different result type than in previous declaration
  PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
  error: 'a' is already declared in this scoping unit / interface a
  error: 'acefcn' was previously called as a function / entry acefcn
  error: 'arr' has rank 30, which is greater than the maximum supported rank 15 / integer :: arr(1,30,30,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30)
  error: 'char' is not an unrestricted specific intrinsic procedure / char_intrinsic=char,&
  error: 'd1' was already declared as a Cray pointee / pointer(n1,d1)
  error: 'ext_sub' is already declared in this scoping unit / subroutine eXt_sUb
  error: 'fun' is already declared in this scoping unit / function Fun(a) result(rr)
  error: 'i' is not an object that can appear in an expression / integer n(1+i(2)-1)
  error: 'ia' cannot backward-extend COMMON block /com/ via EQUIVALENCE with 'i1' / common /com/ ia(10)
  error: 'ib' is storage associated with 'ia' by EQUIVALENCE elsewhere in COMMON block /com03/ / common /com03/ ia(10),ib(10),ic(10)
  error: 'ifun05' was previously called as a function / subroutine ifun05(i,j)
  error: 'int' not found in module 'mod' / use mod,only:iii,int,inta
  error: 'int1' is not a known intrinsic procedure / intrinsic int1,jfix
  error: 'isub01' is already declared in this scoping unit / entry isub01(ipp)
  error: 'jfun1' is already declared in this scoping unit / recursive function Jfun1(ii) result(ians)
  error: 'jjj' not found in module 'mod2a' / use mod2a,only:jjj,int,ifunc
  error: 'jjja' not found in module 'mod2a' / use mod2a,only:aaa=>aaa,jjja
  error: 'l6lxicrqtg0jsrv4prfygwi' not found in module 'xhcw9knwd' / USE XHCW9KNWD,CCNTJOFHGFDX=>L6LXICRQTG0JSRV4PRFYGWI
  error: 'n' is not an object that can appear in an expression / dimension a(n(2))
  error: 'n1' is not an object that can appear in an expression / integer i1(n1(1))
  error: 'sub' is already declared in this scoping unit / subroutine sub(i)
  error: 'target=' argument has unacceptable rank 0 / ans=associated(i,null())
  error: 'xd' is not an object that can appear in an expression / EQUIVALENCE (FD,XD)
  error: /a1/ is not a known STRUCTURE / record /a1/ av
  error: A dummy procedure may not be ELEMENTAL / elemental function op ( x )
  error: A length specifier cannot be used to declare the non-character entity 'b' / integer*4 b*2/10/
  error: A length specifier cannot be used to declare the non-character entity 'i' / integer(4) i*(8),j    
  error: ALLOCATABLE dummy argument 'k=' must be associated with an ALLOCATABLE actual argument / call sub(fun())
  error: Actual argument associated with INTENT(OUT) dummy argument 'p1=' must be definable / call sub01(struct01%struct02(1)%int02)
  error: Actual argument for 'a=' has bad type 'INTEGER(4)' / if (ifix(20).ne.20) write(6,*) "NG"
  error: Actual argument for 'string=' has bad type 'INTEGER(4)' / integer i1(LEN(n1))
  error: Actual argument type 'REAL(4)' is not compatible with dummy argument type 'INTEGER(4)' / call sub01(val(cha(1)//cha(2)//cha(3)))
  error: Actual procedure argument has interface incompatible with dummy argument 'proc=': incompatible dummy argument #1: incompatible dummy data object intents / call subr1(fi)
  error: An initialized variable in BLOCK DATA must be in a COMMON block / integer i,j,k
  error: Argument of ALLOCATED() must be an ALLOCATABLE object or component / if ( allocated(fun(a)) .and. any( fun(a) /= (/1,2,1/) ) .and. &
  error: Array 'yyy' without ALLOCATABLE or POINTER attribute must have explicit shape / integer,intent(in) :: yyy(:)
  error: CYCLE construct-name is not in scope / CYCLE JFU
  error: Cannot call subroutine 'lqf' like a function / n1=lqf(n1,1)
  error: Cannot read module file for module 'user_function_choice': Source file 'user_function_choice.mod' was not found / use user_function_choice
  error: Cannot use-associate 'araloc'; it is already declared in this scope / USE modinf
  error: Cannot use-associate generic interface 'addition' with specific procedure of the same name when another such generic is in scope / Use IntStuff
  error: DATA statement value 'int(zaffeebbe,kind=4)' for 'c(1_8)' is not a constant                       
  error: DATA statement value 'real(z8000000000000000,kind=8)' for 'm0' is not a constant / REAL(8) :: M0/Z8000000000000000/
  error: DATA statement value could not be converted to the type 'CHARACTER(KIND=1,LEN=8_8)' of the object 'name' / data name/z'96bc914f81408140'/
  error: DO controls should be INTEGER / do i=.true.,10
  error: Default-initialized 'i01' must not be initialized in a DATA statement / data i01 /1*1/     !
  error: Default-initialized 'str1' must not be initialized in a DATA statement / data str1,str2,str3,str4 /4*ty1(3,4)/
  error: Derived type '/hru2tuj03d94ragyx/' not found / RECORD /HRU2TUJ03D94RAGYX/ A445MV0HS4_6W43KK58F84(65:65,1:1,1:1), &
  error: Derived type '/o_calc/' not found / RECORD /O_CALC/ O(1:1_1,-83_4:-83)
  error: Derived type variable 'str' may not appear in a COMMON block due to component with default initialization / common /com1/ i1,i2,str
  error: Dimension 1 of left-hand side has extent 1, but right-hand side has extent 4 / r=reshape((/d/),(/4,1,1/)) !print *,d
  error: Dummy argument 'c=' (#3) is not OPTIONAL and is not associated with an actual argument in this procedure reference / BSign = + Sign (A, C)
  error: Duplicate UNIT specifier / OPEN(20,'testu.dat',STATUS='unknown')
  error: EXIT construct-name is not in scope / EXIT HT13ZQZ4RQS
  error: Entity in ALLOCATE statement must have the ALLOCATABLE or POINTER attribute / allocate(mv3(2,2))
  error: Expected 'F' edit descriptor '.d' value / write(cm,'(2f11)') sf(i1)
  error: Explicit initializations of equivalenced objects affect 'b(1_8)' more than once / integer b(10)
  error: External I/O is not allowed in a pure subprogram / if (size(a1).ne.1) write(6,*) "NG"
  error: Function cannot have both an explicit type prefix and a RESULT suffix / complex(4)::dd(3,2)
  error: Generic 'assignment(=)' may not have specific procedures 'ifun' and 'jfun' as their interfaces are not distinguishable / interface assignment(=)
  error: IMPLICIT statements must follow USE and IMPORT and precede all other declarations / implicit character (len=n(2)) (a)
  error: If FILE appears, UNIT must not appear / if (0.eq.1) inquire(6,file='aaaa',iostat=i)               
  error: Implicit declaration of function 'jfunc02' has a different result type than in previous declaration / ifun=jfunc02(a)
  error: Implicitly typed local entity 'kk' not allowed in specification expression / pointer (jj,kk)
  error: Implied-shape array 'ia' must be a named constant or a dummy argument / pointer(i,ia(*))
  error: Incomplete character literal / if (abs((i123456789,j1234567890123)-(1,2))>0.000001)write(6,*) "NG"
  error: Initialization expression cannot be converted to declared type of 'a01' / logical(kind=8) :: a01=B'1'
  error: Invalid ACTION value 'both' / 1 ACTION='both',FORM='FORMATTED')
  error: Invalid specification expression: reference to OPTIONAL dummy argument 'd' / integer::r(size(d))
  error: LOGICAL operands must be compared using .EQV. or .NEQV. / if (any(tt/=(/.false.,.true.,.false./)))print *,'error-1'
  error: Left-hand side of assignment is not modifiable / struct01%struct02(1)%char02 = "0"                
  error: Multiple initialization of COMMON block /cmn/ / common /cmn/i
  error: Must be a constant value / integer :: a01=z2
  error: Must be a scalar value, but is a rank-2 array / INTEGER*4 G(1:X0VFH86MK7GNSFWYN5RLD-(S))
  error: Must have INTEGER type, but is REAL(4) / write(8,*)(1,r=1,10)
  error: No explicit type declared for 'sub' / subroutine dsp_root(sub,icon)
  error: No intrinsic or user-defined ASSIGNMENT(=) matches operand types REAL(4) and LOGICAL(4) / BAR = .TRUE.
  error: Operands of .EQ. must have comparable types; have INTEGER(4) and LOGICAL(4) / forall (i=1:1,jx==aa(1,1,1))
  error: Operands of .NE. must have comparable types; have LOGICAL(4) and INTEGER(1) / parameter (ia01=ishc(2_1, 3).ne.ishftc(2_1, 3))
  error: Procedure 'p' is referenced before being sufficiently defined in a context where it must be so
  error: Recursive call to 'is1' requires a distinct RESULT in its declaration / j= is1(i+1)
  error: Reference to rank-2 object 'az1' has 1 subscripts / equivalence (az1(1),az2(1,1))
  error: References to the procedure 'd7tpr' require an explicit interface / s = d7tpr(p, v(step1:), v(step1:))
  error: Result of ENTRY is not compatible with result of containing function / ENTRY    TAN(W1,W2)
  error: The type of 'i' has already been implicitly declared / integer*8 i,ifun,ii
  error: Type of Cray pointee 'vp' is a non-sequence derived type / pointer(ip,vp)
  error: Unexpected ',' in format expression / WRITE(6,FMT='(1H ,/22X,''CORRECT  VAL : '',                   &
  error: Unexpected '<' in format expression / write(1,'(1h ,i<i+j>.<i+j>)') 3
  error: Unexpected 'Q' in format expression / read(1,'(i3,q)') i,j
  error: Unexpected 'R' in format expression / write(1,'(10r,i3)') 11
  error: Unimplemented CARRIAGECONTROL value 'fortran' / OPEN (3, FILE = 'fort.3', carriagecontrol = 'fortran')
  error: Unmatched '(' / CALL EXP ( &10)
  error: Unmatched '(' / write(1'2,3) 1
  error: VOLATILE attribute may apply only to a variable / integer function fun1() result(res)             
  error: Values in array constructor must have the same declared type when no explicit type appears / a(1)%za=(/2.0,3/)
  error: Variable 'a' with TARGET attribute is not allowed in an equivalence set / equivalence
  error: expected '(' / automatic :: a,b
  error: expected '(' / changeentry st01
  error: expected '(' / definefile 10(10,10,E,i)
  error: expected '(' / module mod4567890123456789012345678901234567890 &
  error: expected '(' / static :: iii
  error: expected '(' / yy.i1y=(/1_1,2_1/)
  error: expected ')' / 10 FORMAT ('1',<i5>X,'OS/700 FORTRAN-A TEST')
  error: expected ')' / VEBBHWACWJJMNWQ3C9TV=(7.80526028342937e13_LP2EY,8.356047210334177e32_ &
  error: expected ')' / _8)
  error: expected ')' / allocate(a.za1(5))
  error: expected ')' / b(1:2).wa(3).xa(4).ya(5) = fun_alloc(2)
  error: expected ')' / deallocate(typeZ_pointer(1).za)
  error: expected ')' / if ( any(j1/=1) .or . any(j2/=1) .or . any(j3/=1) .or . &
  error: expected ')' / open(1,blocksize=10000)
  error: expected ')' / parameter (ii12345     28282=4,j j 1 2 3 4 5 6 7 8 9=5)
  error: expected '/' / a23456789a23456789a23456789a23456789a23456789 &
  error: expected ':' / 504  FORMAT(3Q15.7)
  error: expected ':' / aa.yp=>func(t1,t2,t3)
  error: expected '=' / BLOCKSIZE=bsize )
  error: expected '=' / INQUIRE( unit=1, FLEN=fs)
  error: expected '=>' / 343 KL9C76QIU0A9191ZMQ.U=-44
  error: expected 'END' / else if(a.lt.b .and. c.gt.d) then
  error: expected 'FORALL' / integer :: aler
  error: expected component definition / union
  error: expected end of statement / a23456789a23456789a23456789a23456789a23456789 & -> Error with whitespace in name
  error: expected object names / volatile :: /com/
  error: expected one of '):' / A4M86Y5RDIS930CACACQJ=RESHAPE((/27_8,2_8,(N1Z2B9WQ%ES),(1_8-(-8_2) &
  error: expected one of '):' / if (.not.allocated(a.za)) write(6,*) "NG"
  error: expected one of '):' / if (loc(pp.za) /= loc(qq.za)) print *,'error 1'
  error: loc("./snggg274.f90":57:5): substring of static array object / a=ap(1:n/3)//'x'(1:n/3)//'x'(1:n/3)
  error: loc("./snggg282.f90":32:2): symbol is not mapped to any IR value / forall (i=x%a(i3-i2,1):x%a(5,1))
  error: loc("./snggm015.f90":2:1): (semantics issue) no assigned goto targets
  error: loc("./snggn162.f90":18:1): symbol is not a dummy in this call
  error: operands must be INTEGER or REAL / write(1,*) ((pi,pi), pi)
  error: type parameter definitions must appear before component declarations / character*1,z11(-3:-1),z21(-5:-4,-9:-7),z12(-3:-1),&
  error:ALLOCATABLE dummy argument 'p=' must be associated with an ALLOCATABLE actual argument / write (u1,*)     i4_f(i='1',p=ptr_nf(1))
  expected 'END FORALL' / end for all
  expected end of statement / integer,automatic::b(3,4)
  expected one of '):' / if (.not.allocated(a.ch3)) write(6,*) "NG"
  flang-new: error: unable to execute command: Killed
  func.func' op symbol declaration cannot have public visibility / type definition                         
  malloc(): invalid size (unsorted)
  mlir/lib/IR/Types.cpp:93: unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion `isIntOrFloat() && "only integers and floats have a bitwidth"' failed.
  n' is not an object that can appear in an expression / integer i(n(2))
  operand #0 does not dominate this use
  operand #1 does not dominate this use
  operand #3 does not dominate this use
  redefinition of symbol named '_FortranADestroy'
  unhandled type in fir.box code generation
  unsigned int mlir::Type::getIntOrFloatBitWidth() const: Assertion `isIntOrFloat() && "only integers and floats have a bitwidth"' failed.


- execution error
  Runtime result error
  Segmentation fault (core dumped)
  fatal Fortran runtime error(./U_of_south_Florida.f90:391): End of file during input
  fatal Fortran runtime error(./d11.f95:15): End of file during input
  fatal Fortran runtime error(./nif001.f90:4): Invalid FORMAT: integer expected at ')'
  fatal Fortran runtime error(./snggg749.f90:410): End of file during input
  fatal Fortran runtime error(./snggg908.f90:92): ACTION= may not be changed on an open unit
  fatal Fortran runtime error(./snggj163.f90:164): Bad character '.' in INTEGER input field
  fatal Fortran runtime error(./snggj408.f90:94): DOT_PRODUCT: SIZE(VECTOR_A) is 33 but SIZE(VECTOR_B) is 29fatal Fortran runtime error
  fatal Fortran runtime error(./snggl323.f90:11): NAMELIST input group 'cntrl' was not terminated at '&'
  fatal Fortran runtime error(./snggm252.f90:7): Base address is null


- internal error(error message)
  fatal internal error: CHECK(exprAnalyzer_.context().AnyFatalError()) failed at /.../llvm-project/flang/lib/Semantics/data-to-inits.cpp(354)

1 Like

Thanks @ohno-fj for collating the results.

  • I think you can skip creating issues for “not yet implemented”.
  • For all non-standard intrinsics, believe these are the undefined reference, like system, rindex, secnds etc please create a single issue listing all of them.
  • For the math intrinsics undefined reference, please file separate issues.
    undefined reference to __fc_pow_1, undefined reference to __fc_powi_1, undefined reference to __mth_i_hypot, undefined reference to __mth_i_ipowi.
    `

Thanks @kiranchandramohan for your comments

I will post the issues in consideration of the comments I received.

Hello, @kiranchandramohan

FYI: I started to report bugs.

https://github.com/llvm/llvm-project/issues/58968
https://github.com/llvm/llvm-project/issues/58969
https://github.com/llvm/llvm-project/issues/58970
https://github.com/llvm/llvm-project/issues/58971
https://github.com/llvm/llvm-project/issues/58972
https://github.com/llvm/llvm-project/issues/58973

I will continue to investigate the remaining test sets and report bugs.

1 Like

Thanks @ohno-fj.

It will be helpful if you could indicate whether the issue is because of a non-standard extension. For e.g, I believe the automatic in [fang] Compilation error in automatic statement · Issue #58968 · llvm/llvm-project · GitHub is an extension.

Thanks @kiranchandramohan for your comments

The following issues are extensions

  automatic statement : https://github.com/llvm/llvm-project/issues/58968
  static    statement : https://github.com/llvm/llvm-project/issues/58969
  cray pointer        : https://github.com/llvm/llvm-project/issues/58971

Hello, @kiranchandramohan

FYI: I posted the issues.

https://github.com/llvm/llvm-project/issues/59103
https://github.com/llvm/llvm-project/issues/59104

I could not reproduce these with the main branch. I see calls to libm functions in the generated LLVM IR instead and hence no linking error.

@szakharin replaced the pgmath calls with libm in the following commit.

commit be8bacfd93ec6a51692aafb3478ce975fb9812d2
Author: Slava Zakharin <szakharin@nvidia.com>
Date:   Thu Aug 4 09:24:33 2022 -0700

    [flang] Replace more pgmath with libm.
    
    With this change all supported pgmath functions for non-complex
    data types are replaced with either libm calls or MLIR operations,
    except for MOD and some flavors of POW, which are going to be addressed
    by other commits.
    
    At the current stage a few math intrinsics are lowered into libm calls
    always. When appropriate MLIR operation are available, the table can be
    updated to generate them.