[flang] Fix for array upper bounds with *
authorValentin Clement <clementval@gmail.com>
Thu, 30 Jun 2022 08:36:47 +0000 (10:36 +0200)
committerValentin Clement <clementval@gmail.com>
Thu, 30 Jun 2022 08:37:22 +0000 (10:37 +0200)
commit411f839ae36f0f56ce0b6c5f4e37039c54bdd9f7
treee0a1bf254282fd6fe9b8da434b0ec95ece680d75
parentc628e9eb5e959c043103eb0c760c796d1396e50f
[flang] Fix for array upper bounds with *

Even though the array is declared with '*' upper bounds, it has an
initial value that has a statically known shape. Use the shape from
the type of the initializer when the declared size is '*'.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D128889

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
flang/lib/Lower/ConvertVariable.cpp
flang/test/Lower/memory-alloc.f90 [new file with mode: 0644]