[flang][lowering] Do not instantiate component symbols used in spec expr
authorJean Perier <jperier@nvidia.com>
Thu, 27 Apr 2023 16:35:51 +0000 (18:35 +0200)
committerJean Perier <jperier@nvidia.com>
Thu, 27 Apr 2023 16:36:53 +0000 (18:36 +0200)
commitcd319489e9118a0c93a88fc6e7a200ec3f161922
treeb8360b8ed27bfd14f9604a28f74c0c035250e690
parentcf792f664a75ea2b45962e81ea4487fc44b00232
[flang][lowering] Do not instantiate component symbols used in spec expr

Lowering analyse specification expressions in order to create order the
symbol instantiations in the IR (If symbol B is used in the
specification expression of A, symbol B must be instantiated first).

This analysis was mistakenly collecting component symbols used in
component references inside specification expressions, which led
lowering to instantiate component symbols as if they were local
objects.

This patch prevents collecting component symbols during this analysis.

Differential Revision: https://reviews.llvm.org/D149328
flang/lib/Lower/PFTBuilder.cpp
flang/test/Lower/HLFIR/convert-variable.f90