[gcc r14-6185] PR modula2/112865 IM and RE fails to skip type equivalences

Gaius Mulley gaius@gcc.gnu.org
Tue Dec 5 14:55:29 GMT 2023


https://gcc.gnu.org/g:805be8fbeab351dc3109aaa17fcc8cc6f74c8caa

commit r14-6185-g805be8fbeab351dc3109aaa17fcc8cc6f74c8caa
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Tue Dec 5 14:54:00 2023 +0000

    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 <gaiusmod2@gmail.com>

Diff:
---
 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 02a7db4efc2..83c9b99759a 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)


More information about the Gcc-cvs mailing list