diff --git a/Gen.pas b/Gen.pas index 2faf765..2aed6d0 100644 --- a/Gen.pas +++ b/Gen.pas @@ -6457,12 +6457,13 @@ procedure GenTree {op: icptr}; end {if} else LoadX(op^.right); - if op^.opcode = pc_mpi then - GenCall(28) + if op^.opcode = pc_mpi then begin + GenCall(28); + if rangeCheck then + GenCall(25); + end {if} else {pc_umi} - GenCall(39); - if rangeCheck then - GenCall(25); + GenCall(94); end; {GenMpi} diff --git a/Native.pas b/Native.pas index 7947096..1de7f29 100644 --- a/Native.pas +++ b/Native.pas @@ -2049,6 +2049,7 @@ case callNum of 91: sp := @'~SINGLEPRECISION'; 92: sp := @'~DOUBLEPRECISION'; 93: sp := @'~COMPPRECISION'; + 94: sp := @'~CUMUL2'; otherwise: Error(cge1); end; {case} diff --git a/cc.notes b/cc.notes index 4c133d0..f49955c 100644 --- a/cc.notes +++ b/cc.notes @@ -262,7 +262,7 @@ ORCA/C now supports additional forms of expressions known as generic selection e p. 311 -If integer overflow occurs during signed integer multiplication, the resulting value is not predictable. Contrary to what the description in the manual implies, it will not necessarily be the low-order bits from the true product of the operands. +If integer overflow occurs during signed integer multiplication, the resulting value is not predictable. Contrary to what the description in the manual implies, it will not necessarily be the low-order bits from the true product of the operands. (Unsigned integer multiplication does give the low-order bits from the true product.) p. 321 @@ -1861,6 +1861,8 @@ int foo(int[42]); 199. If a file is open for reading and writing, it should be possible to read from it until end-of-file is encountered and then immediately write to it, but an error would be reported when the write was attempted. +200. Arithmetic operations on unsigned integer types should give the low-order bits of the true mathematical result in the event of overflow, but 16-bit unsigned multiplication did not always do this. + -- Bugs from C 2.1.0 that have been fixed ----------------------------------- 1. In some situations, fread() reread the first 1K or so of the file.