[flang-commits] [flang] 11c43cd - [flang] Fix "not yet implemented" message for CHARACTER MIN/MAX
Valentin Clement via flang-commits
flang-commits at lists.llvm.org
Thu Jun 30 09:13:35 PDT 2022
Author: Valentin Clement
Date: 2022-06-30T18:13:22+02:00
New Revision: 11c43cd2de5a8f9c152ab6f8967ff0781ec727b7
URL: https://github.com/llvm/llvm-project/commit/11c43cd2de5a8f9c152ab6f8967ff0781ec727b7
DIFF: https://github.com/llvm/llvm-project/commit/11c43cd2de5a8f9c152ab6f8967ff0781ec727b7.diff
LOG: [flang] Fix "not yet implemented" message for CHARACTER MIN/MAX
The check to see if the arguments for the MIN/MAX intrinsics were of CHARACTER
type was not handling assumed length characters. In this case, the FIR type is
"!fir.ref<!fir.char<1,?>>".
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D128922
Co-authored-by: Peter Steinfeld <psteinfeld at nvidia.com>
Added:
Modified:
flang/lib/Lower/IntrinsicCall.cpp
Removed:
################################################################################
diff --git a/flang/lib/Lower/IntrinsicCall.cpp b/flang/lib/Lower/IntrinsicCall.cpp
index c9aa91b2b6c5..9d2094c5c1cd 100644
--- a/flang/lib/Lower/IntrinsicCall.cpp
+++ b/flang/lib/Lower/IntrinsicCall.cpp
@@ -4063,7 +4063,7 @@ static mlir::Value createExtremumCompare(mlir::Location loc,
} else if (fir::isa_integer(type)) {
result =
builder.create<mlir::arith::CmpIOp>(loc, integerPredicate, left, right);
- } else if (fir::isa_char(type)) {
+ } else if (fir::isa_char(type) || fir::isa_char(fir::unwrapRefType(type))) {
// TODO: ! character min and max is tricky because the result
// length is the length of the longest argument!
// So we may need a temp.
More information about the flang-commits
mailing list