From: Gaius Mulley Date: Tue, 5 Dec 2023 14:54:00 +0000 (+0000) Subject: PR modula2/112865 IM and RE fails to skip type equivalences X-Git-Tag: basepoints/gcc-15~3954 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=805be8fbeab351dc3109aaa17fcc8cc6f74c8caa;p=thirdparty%2Fgcc.git 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 --- 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)