[flang-commits] [flang] [flang] fix codegen warning from #73641 (PR #73808)

via flang-commits flang-commits at lists.llvm.org
Wed Nov 29 07:41:56 PST 2023


https://github.com/jeanPerier created https://github.com/llvm/llvm-project/pull/73808

None

>From 9e6f44d68961175f57abc50e623a41c811a45369 Mon Sep 17 00:00:00 2001
From: Jean Perier <jperier at nvidia.com>
Date: Wed, 29 Nov 2023 07:39:41 -0800
Subject: [PATCH] [flang] fix codegen warning from #73641

---
 flang/lib/Optimizer/CodeGen/CodeGen.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index 38227f5c02a7ca5..408377f1d7a1762 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -3667,9 +3667,9 @@ struct BoxOffsetOpConversion : public FIROpConversion<fir::BoxOffsetOp> {
     mlir::Type boxType = fir::unwrapRefType(boxOffset.getBoxRef().getType());
     mlir::Type llvmBoxTy =
         lowerTy().convertBoxTypeAsStruct(mlir::cast<fir::BaseBoxType>(boxType));
-    unsigned fieldId = boxOffset.getField() == fir::BoxFieldAttr::derived_type
-                           ? getTypeDescFieldId(boxType)
-                           : kAddrPosInBox;
+    int fieldId = boxOffset.getField() == fir::BoxFieldAttr::derived_type
+                      ? getTypeDescFieldId(boxType)
+                      : kAddrPosInBox;
     rewriter.replaceOpWithNewOp<mlir::LLVM::GEPOp>(
         boxOffset, pty, llvmBoxTy, adaptor.getBoxRef(),
         llvm::ArrayRef<mlir::LLVM::GEPArg>{0, fieldId});



More information about the flang-commits mailing list