[all-commits] [llvm/llvm-project] 4489ef: [flang] Fix LBOUND with assumed size array and non...
Valentin Clement (バレンタイン クレメン) via All-commits
all-commits at lists.llvm.org
Fri Jun 24 12:02:24 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4489ef8e34fefcbbf4fe44d1307b0cc41a12cfa8
https://github.com/llvm/llvm-project/commit/4489ef8e34fefcbbf4fe44d1307b0cc41a12cfa8
Author: Valentin Clement <clementval at gmail.com>
Date: 2022-06-24 (Fri, 24 Jun 2022)
Changed paths:
M flang/lib/Lower/IntrinsicCall.cpp
M flang/test/Lower/Intrinsics/lbound.f90
Log Message:
-----------
[flang] Fix LBOUND with assumed size array and non constant DIM
LBOUND with a non constant DIM argument use the runtime to allow runtime
verification of DIM <= RANK. The interface uses a descriptor. This caused
undefined behavior because the runtime believed it was seeing an explicit
shape arrays with zero extent and returned `1` (the runtime descriptor
does not allow making a difference between an explicit shape and an
assumed size. Assumed size are not meant to be described by runtime
descriptors).
Fix the issue by setting the last extent of assumed size to `1` when
creating the descriptor to inquire about the LBOUND with the runtime.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D128509
Co-authored-by: Jean Perier <jperier at nvidia.com>
More information about the All-commits
mailing list