From 805be8fbeab351dc3109aaa17fcc8cc6f74c8caa Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Tue, 5 Dec 2023 14:54:00 +0000 Subject: [PATCH] PR modula2/112865 IM and RE fails to skip type equivalences This patch skip type equivalences when checking IM and RE ISO M2 standard functions for complex data type operands. gcc/m2/ChangeLog: PR modula2/112865 * gm2-compiler/M2Quads.mod (BuildReFunction): Use GetDType to retrieve the type of the operand when converting the complex type to its scalar equivalent. (BuildImFunction): Use GetDType to retrieve the type of the operand when converting the complex type to its scalar equivalent. Signed-off-by: Gaius Mulley --- gcc/m2/gm2-compiler/M2Quads.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2Quads.mod b/gcc/m2/gm2-compiler/M2Quads.mod index 02a7db4efc27..83c9b99759a2 100644 --- a/gcc/m2/gm2-compiler/M2Quads.mod +++ b/gcc/m2/gm2-compiler/M2Quads.mod @@ -9845,7 +9845,7 @@ BEGIN IF IsVar(Var) OR IsConst(Var) THEN ReturnVar := MakeTemporary (combinedtok, AreConstant (IsConst (Var))) ; - PutVar (ReturnVar, ComplexToScalar (GetSType (Var))) ; + PutVar (ReturnVar, ComplexToScalar (GetDType (Var))) ; GenQuadO (combinedtok, StandardFunctionOp, ReturnVar, Re, Var, FALSE) ; PopN (NoOfParam+1) ; (* destroy arguments to this function *) PushTFtok (ReturnVar, GetSType (ReturnVar), combinedtok) @@ -9913,7 +9913,7 @@ BEGIN IF IsVar(Var) OR IsConst(Var) THEN ReturnVar := MakeTemporary (combinedtok, AreConstant (IsConst (Var))) ; - PutVar (ReturnVar, ComplexToScalar (GetSType (Var))) ; + PutVar (ReturnVar, ComplexToScalar (GetDType (Var))) ; GenQuadO (combinedtok, StandardFunctionOp, ReturnVar, Im, Var, FALSE) ; PopN (NoOfParam+1) ; (* destroy arguments to this function *) PushTFtok (ReturnVar, GetSType (ReturnVar), combinedtok) -- 2.47.2