[flang] Use rank from the allocate object when allocate with mold
authorValentin Clement <clementval@gmail.com>
Thu, 2 Feb 2023 09:23:06 +0000 (10:23 +0100)
committerValentin Clement <clementval@gmail.com>
Thu, 2 Feb 2023 09:23:53 +0000 (10:23 +0100)
commit696ad1394e88b417b934a6beb7d22fb28ab75144
tree30a2c67d3d65ec9b7988e3f22cd6547aa11e05e2
parent4f4b2161ec3cc42890aa9a445588d5a9a67e9033
[flang] Use rank from the allocate object when allocate with mold

The rank from the allocate object might be different from the rank
from the mold expression. Use the rank from the allocate object
when applying to mold so the bounds can be set correctly.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D143078
flang/include/flang/Runtime/allocatable.h
flang/include/flang/Runtime/pointer.h
flang/lib/Lower/Allocatable.cpp
flang/runtime/allocatable.cpp
flang/runtime/pointer.cpp
flang/test/Lower/allocatable-polymorphic.f90
flang/test/Lower/allocatable-runtime.f90
flang/test/Lower/polymorphic-temp.f90