llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[flang] Issue with coarray lowering

Open eugeneepshteyn opened this issue 1 year ago • 3 comments

(I realize that coarray lowering is at a very experimental stage, but I noticed the issue and wanted to document it.)

Compiling https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/pr71706.f90

By default, error on line 8:

$ flang -c -fcoarray pr71706.f90
warning: Support for multi image Fortran features is still experimental and in development.
error: loc(".../pr71706.f90":8:3): 'fir.rebox' op op input and output element types must match for intrinsic types
error: verification of lowering to FIR failed

Compiling with -fdefault-integer-8 (as pr71706.f90 requires) results in error on line 7:

$ flang -c -fcoarray -fdefault-integer-8 /home/eepshteyn/src/pgi/ta/tests/gfortran/tests/gfortran.dg/pr71706.f90
warning: Support for multi image Fortran features is still experimental and in development.
error: loc(".../pr71706.f90":7:3): 'fir.rebox' op op input and output element types must match for intrinsic types
error: verification of lowering to FIR failed

It seems that lowering should emit proper type conversions, like for other intrinsic functions.

flang version:

flang version 22.0.0git (https://github.com/llvm/llvm-project ad9d551e5568e155005e569a0c9527b6e45c92b8)
Target: x86_64-unknown-linux-gnu
Thread model: posix

eugeneepshteyn avatar Sep 14 '25 14:09 eugeneepshteyn

@llvm/issue-subscribers-bug

Author: Eugene Epshteyn (eugeneepshteyn)

(I realize that coarray lowering is at a very experimental stage, but I noticed the issue and wanted to document it.)

Compiling https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/pr71706.f90

By default, error on line 8:

$ flang -c -fcoarray pr71706.f90
warning: Support for multi image Fortran features is still experimental and in development.
error: loc(".../pr71706.f90":8:3): 'fir.rebox' op op input and output element types must match for intrinsic types
error: verification of lowering to FIR failed

Compiling with -fdefault-integer-8 (as pr71706.f90 requires) results in error on line 7:

$ flang -c -fcoarray -fdefault-integer-8 /home/eepshteyn/src/pgi/ta/tests/gfortran/tests/gfortran.dg/pr71706.f90
warning: Support for multi image Fortran features is still experimental and in development.
error: loc(".../pr71706.f90":7:3): 'fir.rebox' op op input and output element types must match for intrinsic types
error: verification of lowering to FIR failed

It seems that lowering should emit proper type conversions, like for other intrinsic functions.

flang version:

flang version 22.0.0git (https://github.com/llvm/llvm-project ad9d551e5568e155005e569a0c9527b6e45c92b8)
Target: x86_64-unknown-linux-gnu
Thread model: posix

llvmbot avatar Sep 14 '25 14:09 llvmbot

@llvm/issue-subscribers-flang-ir

Author: Eugene Epshteyn (eugeneepshteyn)

(I realize that coarray lowering is at a very experimental stage, but I noticed the issue and wanted to document it.)

Compiling https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/pr71706.f90

By default, error on line 8:

$ flang -c -fcoarray pr71706.f90
warning: Support for multi image Fortran features is still experimental and in development.
error: loc(".../pr71706.f90":8:3): 'fir.rebox' op op input and output element types must match for intrinsic types
error: verification of lowering to FIR failed

Compiling with -fdefault-integer-8 (as pr71706.f90 requires) results in error on line 7:

$ flang -c -fcoarray -fdefault-integer-8 /home/eepshteyn/src/pgi/ta/tests/gfortran/tests/gfortran.dg/pr71706.f90
warning: Support for multi image Fortran features is still experimental and in development.
error: loc(".../pr71706.f90":7:3): 'fir.rebox' op op input and output element types must match for intrinsic types
error: verification of lowering to FIR failed

It seems that lowering should emit proper type conversions, like for other intrinsic functions.

flang version:

flang version 22.0.0git (https://github.com/llvm/llvm-project ad9d551e5568e155005e569a0c9527b6e45c92b8)
Target: x86_64-unknown-linux-gnu
Thread model: posix

llvmbot avatar Sep 14 '25 15:09 llvmbot

Hi @eugeneepshteyn, thanks for the issue! I'll take a look on that point.

JDPailleux avatar Sep 18 '25 06:09 JDPailleux