Skip to content

[Flang] Compilation error of using %VAL for an actual argument #118239

@ohno-fj

Description

@ohno-fj
Version of flang : 20.0.0(590f451b60d434b26c634a07125fb05baf461fa0)/AArch64

Using %VAL (which specifies that the actual argument should be passed by value) for an actual argument results in a compilation error (LLVM IR failed).

The following are the test program, Flang, Gfortran and ifx compilation/execution result.

snggf047_22.f90:

program main
  logical::a1
  data a1/.true./
  call sa(%val(a1))
  write(6,*) "a1 = ", a1
end program main

subroutine sa(x1)
  logical::x1
end subroutine sa
$ flang snggf047_22.f90
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/MCS/v3f/snggf047_22.f90":4:3): unsupported types for logical conversion: 'i32' -> '!llvm.ptr'
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/MCS/v3f/snggf047_22.f90":4:3): failed to legalize operation 'fir.convert'
error: Lowering to LLVM IR failed
error: loc("/work/home/ohno/CT/test/fort/tp/reproducerJ/MCS/v3f/snggf047_22.f90":1:1): cannot be converted to LLVM IR: missing `LLVMTranslationDialectInterface` registration for dialect for op: func.func
error: failed to create the LLVM module
$
$ gfortran snggf047_2.f90; ./a.out
 a1 =  T
$
$ ifx snggf047_2.f90; ./a.out
 a1 =  T
$

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions