Issue 98980
Summary [Flang] Execution error (Aborted) when the array size of the return value of pack intrinsic function is different from the array size of the assignment target
Labels flang:runtime
Assignees
Reporter ohno-fj
    ```
Version of flang-new : 19.0.0(73447a3302541c343525570222b318e7f94f9402)/AArch64
```

When the array size of the return value of `pack intrinsic function` is different from the array size of the assignment target, the execution terminates abnormally (Aborted).  
When the value of a `logical` variable is changed from .false. to .true., the execution terminates normally.

The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.

cv1035_22.f90:
```fortran
program main
  integer*8 a(2),c(2)
  logical*4 g
  data a/2*1/,g/.false./
  c = pack(a,g)
end program main
```

```
$ flang-new cv1035_22.f90; ./a.out

fatal Fortran runtime error(/work/home/ohno/CT/test/fort/tp/reproducerJ/Metro/CHMK23/cv1035_22.f90:5): Assign: mismatching element counts in array assignment (to 2, from 0)
Aborted (core dumped)
$
```

```
$ gfortran cv1035_22.f90; ./a.out
$ 
```

```
$ ifort -diag-disable=10448 cv1035_22.f90; ./a.out
$
```

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to