[all-commits] [llvm/llvm-project] d07f23: [flang][hlfir] Use actual type when copying an act...
jeanPerier via All-commits
all-commits at lists.llvm.org
Thu May 25 08:44:17 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d07f23e033220b7fbc47b40172de647c09364c62
https://github.com/llvm/llvm-project/commit/d07f23e033220b7fbc47b40172de647c09364c62
Author: Jean Perier <jperier at nvidia.com>
Date: 2023-05-25 (Thu, 25 May 2023)
Changed paths:
M flang/lib/Lower/ConvertCall.cpp
A flang/test/Lower/HLFIR/calls-constant-expr-arg-polymorphic.f90
Log Message:
-----------
[flang][hlfir] Use actual type when copying an actual argument variable
The copy must made according to the actual type, not the dummy type. In
case the dummy is polymorphic, these types will be different and the
dynamic type of the copy passed in the call should be the one of the
actual.
There is no support for "class(t), value" yet (it is hitting a TODO in
CallInterface that is moot for HLFIR but has not been lifted for lack of
proper testing) so the bug was dormant, but D151271 created a situation
where a copy is needed with polymorphic dummies and exposed the bug.
This led to a compile time assert
"value.isScalar() && fir::isa_trivial(value.getType())" in "hlfir::genAssociateExpr".
Differential Revision: https://reviews.llvm.org/D151413
More information about the All-commits
mailing list