From d5a9aa77a2d578d23121629c2ff6860b434de195 Mon Sep 17 00:00:00 2001 From: William Chen Date: Fri, 4 Nov 2022 15:05:10 -0700 Subject: [PATCH] Rematerialize of struct and union is the same --- src/mapleall/maple_be/src/cg/rematerialize.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapleall/maple_be/src/cg/rematerialize.cpp b/src/mapleall/maple_be/src/cg/rematerialize.cpp index a9db0a12cc..17387a930c 100644 --- a/src/mapleall/maple_be/src/cg/rematerialize.cpp +++ b/src/mapleall/maple_be/src/cg/rematerialize.cpp @@ -138,7 +138,7 @@ std::vector Rematerializer::Rematerialize(CGFunc &cgFunc, RegOperand ® const MIRSymbol *symbol = rematInfo.sym; int32 offset = 0; if (fieldID != 0) { - ASSERT(symbol->GetType()->IsMIRStructType(), "non-zero fieldID for non-structure"); + ASSERT(symbol->GetType()->IsMIRStructType() || symbol->GetType()->IsMIRUnionType(), "non-zero fieldID for non-structure"); MIRStructType *structType = static_cast(symbol->GetType()); offset = cgFunc.GetBecommon().GetFieldOffset(*structType, fieldID).first; } @@ -151,4 +151,4 @@ std::vector Rematerializer::Rematerialize(CGFunc &cgFunc, RegOperand ® return std::vector(); } -} /* namespace maplebe */ \ No newline at end of file +} /* namespace maplebe */ -- Gitee