[BUG REPORT] SetBit and Optimizer

Thomas.AC
Benutzer
Avatar
Gender: n/a
Age: 43
Posts: 308
Registered: 07 / 2013
Subject:

[BUG REPORT] SetBit and Optimizer

 · 
Posted: 06.11.2017 - 21:49  ·  #1
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

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
[BUG REPORT] SetBit and Optimizer
Filename: setBitOptimizerBug.png
Filesize: 49.32 KB
Title:
Download counter: 122
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1409
Registered: 03 / 2005
Subject:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Posted: 07.11.2017 - 09:50  ·  #2
Hi Thomas.

I will check this out. It will speed things up slightly if you can send me the asm and dsm files via pm.

Thanks

Merlin
Thomas.AC
Benutzer
Avatar
Gender: n/a
Age: 43
Posts: 308
Registered: 07 / 2013
Subject:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Posted: 07.11.2017 - 12:41  ·  #3
Sorry. I have no access to my test Project now.
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1409
Registered: 03 / 2005
Subject:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Posted: 07.11.2017 - 14:02  ·  #4
Hi Thomas.

No problem. I have managed to recreate the problem and am working on it.
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1409
Registered: 03 / 2005
Subject:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Posted: 08.11.2017 - 11:48  ·  #5
Hi Thomas.

I now have a fix for this problem and sent it to Rolf for inclusion in the next release.

If you need it sooner, drop me a line via pm with your e-mail and I will send you a dropbox link.
Thomas.AC
Benutzer
Avatar
Gender: n/a
Age: 43
Posts: 308
Registered: 07 / 2013
Subject:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Posted: 08.11.2017 - 13:20  ·  #6
Thank you.

I am going to wait for the next release, because I could compile the project of concerns without optimization at this moment, too.
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 16 · Cache Hits: 15   109   124 · Page-Gen-Time: 0.042745s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI