[flang] Set correct box type when emboxing temporary in array value copy pass
authorValentin Clement <clementval@gmail.com>
Tue, 6 Dec 2022 14:02:14 +0000 (15:02 +0100)
committerValentin Clement <clementval@gmail.com>
Tue, 6 Dec 2022 14:02:35 +0000 (15:02 +0100)
commit11760b3a27ea26c433b2df7b56798d918c62a813
tree87dfb97688cc09ac3aeb90863c5267de8ca848a3
parent7f4429c0e48b9c7d31ff587604707cf10d3acdf0
[flang] Set correct box type when emboxing temporary in array value copy pass

In some cases, the base type is already a fir.box type. This patch updates
the code to set the result box type to fir.box<T>, where T is the type
of the allocated temp.

This was reported in https://github.com/llvm/llvm-project/issues/59342

Reviewed By: jeanPerier, tblah

Differential Revision: https://reviews.llvm.org/D139401
flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp
flang/test/Fir/array-value-copy-3.fir
flang/test/Fir/array-value-copy-4.fir [new file with mode: 0644]