flang icon indicating copy to clipboard operation
flang copied to clipboard

ICE for vector subscript for array of derived types

Open Beliavsky opened this issue 4 years ago • 1 comments

Compiling

implicit none
type :: foo 
   integer :: bar
end type foo
type(foo) :: x(1)
x%bar = 0
print*,x([1])
end

gives

F90-W-0000-Internal compiler error. gen_derived_io, f90 output not implemented     628  (xflang.f90: 7)
F90-S-0000-Internal compiler error. add_arg called with too many arguments, or one begin_call mixed in with another       4  (xflang.f90: 7)
F90-S-0000-Internal compiler error. add_arg called with too many arguments, or one begin_call mixed in with another       5  (xflang.f90: 7)
F90-S-0000-Internal compiler error. add_arg called with too many arguments, or one begin_call mixed in with another       6  (xflang.f90: 7)
F90-S-0000-Internal compiler error. add_arg called with too many arguments, or one begin_call mixed in with another       7  (xflang.f90: 7)
  0 inform,   1 warnings,   4 severes, 0 fatal for MAIN

using this version of flang:

clang version 7.0.1 
Target: x86_64-pc-linux-gnu
Thread model: posix

Beliavsky avatar Dec 19 '20 15:12 Beliavsky

This is probably a bug specific to the print (I/O) statement. Assigning x([1]) to a temporary variable and printing the temporary variable appears to work.

mleair avatar Dec 29 '20 02:12 mleair