Skip to content

Commit

Permalink
[flang] Fix "not yet implemented" message for CHARACTER MIN/MAX
Browse files Browse the repository at this point in the history
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@nvidia.com>
  • Loading branch information
clementval and psteinfeld committed Jun 30, 2022
1 parent 1d83a16 commit 11c43cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flang/lib/Lower/IntrinsicCall.cpp
Expand Up @@ -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.
Expand Down

0 comments on commit 11c43cd

Please sign in to comment.