]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR modula2/112865 IM and RE fails to skip type equivalences
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 5 Dec 2023 14:54:00 +0000 (14:54 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 5 Dec 2023 14:54:00 +0000 (14:54 +0000)
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 <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2Quads.mod

index 02a7db4efc2755393cf70a96d2703bdbdbe4f5ab..83c9b99759a258c153541c4c15db6c5add71f552 100644 (file)
@@ -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)