gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Typo in bitset ops trigger compiler assertion


From: Runar Tenfjord
Subject: Typo in bitset ops trigger compiler assertion
Date: Thu, 17 Nov 2022 11:46:03 +0100

Hello,

The following code trigger a compiler assertion:
MODULE test;
FROM libc IMPORT printf;

VAR
    i : CARDINAL;
BEGIN
    i := VAL(CARDINAL, VAL(BITSET, 0F0H) / (~VAL(BITSET, 0FH));
    printf("i = %d\n", i);
END test.

I discovered this accidently when testing the bit operations in the supplied PIM library
and did not get it to work correctly.

There seems to be a type in the definition of XOR.

 Line 114 in 'gcc/m2/gm2-libs-pim/BitByteOps.mod':
RETURN VAL (BYTE, VAL (BITSET8, left) DIV VAL (BITSET8, right))
 
Should be:
RETURN VAL (BYTE, VAL (BITSET8, left) / VAL (BITSET8, right)) 

This  also to affect the other BitXXXOps files.

Best regards
Runar Tenfjord

reply via email to

[Prev in Thread] Current Thread [Next in Thread]