Hi Rolf or Merlin,
setBit does not compute correctly when compiling with Optimisation.
The screenshot shows the wrong result in the variable out, which should be zero.
Thanks for bugfixing this issue.
AVRco = 5.9.20
Optimiser = 3.4.5.0
program myTest;
Device = mega2560, VCC=5;
Define_Fuses
NoteBook = A;
COMport = USB;
LockBits0 = [];
FuseBits0 = [CKSEL0, CKSEL2, CKSEL3, SUT0, CKDIV8];
FuseBits1 = [SPIEN, JTAGEN, OCDEN];
FuseBits2 = [];
Import SysTick;
From System Import;
Define
ProcClock = 16000000; {Hertz}
SysTick = 10; {msec}
StackSize = $0064, iData;
FrameSize = $0064, iData;
Implementation
{$IDATA}
var
s0[@PINC, 0] : bit;
out : byte;
{ Main Program }
{$IDATA}
begin
EnableInts;
loop
setBit(out, 0 ,Bit(s0));
endloop;
end myTest.
setBit does not compute correctly when compiling with Optimisation.
The screenshot shows the wrong result in the variable out, which should be zero.
Thanks for bugfixing this issue.
AVRco = 5.9.20
Optimiser = 3.4.5.0
Code
program myTest;
Device = mega2560, VCC=5;
Define_Fuses
NoteBook = A;
COMport = USB;
LockBits0 = [];
FuseBits0 = [CKSEL0, CKSEL2, CKSEL3, SUT0, CKDIV8];
FuseBits1 = [SPIEN, JTAGEN, OCDEN];
FuseBits2 = [];
Import SysTick;
From System Import;
Define
ProcClock = 16000000; {Hertz}
SysTick = 10; {msec}
StackSize = $0064, iData;
FrameSize = $0064, iData;
Implementation
{$IDATA}
var
s0[@PINC, 0] : bit;
out : byte;
{ Main Program }
{$IDATA}
begin
EnableInts;
loop
setBit(out, 0 ,Bit(s0));
endloop;
end myTest.
Attachments
Filename: | setBitOptimizerBug.png |
Filesize: | 49.32 KB |
Title: | |
Download counter: | 122 |