[BUG REPORT] SetBit and Optimizer

Thomas.AC
Benutzer
Avatar
Geschlecht: keine Angabe
Alter: 44
Beiträge: 308
Dabei seit: 07 / 2013
Betreff:

[BUG REPORT] SetBit and Optimizer

 · 
Gepostet: 06.11.2017 - 21:49 Uhr  ·  #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.
Der an diesem Beitrag angefügte Anhang ist entweder nur im eingeloggten Zustand sichtbar oder die Berechtigung Deiner Benutzergruppe ist nicht ausreichend.
Merlin
Administrator
Avatar
Geschlecht:
Alter: 25
Beiträge: 1474
Dabei seit: 03 / 2005
Betreff:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Gepostet: 07.11.2017 - 09:50 Uhr  ·  #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
Geschlecht: keine Angabe
Alter: 44
Beiträge: 308
Dabei seit: 07 / 2013
Betreff:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Gepostet: 07.11.2017 - 12:41 Uhr  ·  #3
Sorry. I have no access to my test Project now.
Merlin
Administrator
Avatar
Geschlecht:
Alter: 25
Beiträge: 1474
Dabei seit: 03 / 2005
Betreff:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Gepostet: 07.11.2017 - 14:02 Uhr  ·  #4
Hi Thomas.

No problem. I have managed to recreate the problem and am working on it.
Merlin
Administrator
Avatar
Geschlecht:
Alter: 25
Beiträge: 1474
Dabei seit: 03 / 2005
Betreff:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Gepostet: 08.11.2017 - 11:48 Uhr  ·  #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
Geschlecht: keine Angabe
Alter: 44
Beiträge: 308
Dabei seit: 07 / 2013
Betreff:

Re: [BUG REPORT] SetBit and Optimizer

 · 
Gepostet: 08.11.2017 - 13:20 Uhr  ·  #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.
Gewählte Zitate für Mehrfachzitierung:   0

Registrierte in diesem Topic

Aktuell kein registrierter in diesem Bereich

Die Statistik zeigt, wer in den letzten 5 Minuten online war. Erneuerung alle 90 Sekunden.
MySQL Queries: 15 · Cache Hits: 14   108   122 · Page-Gen-Time: 0.03414s · Speichernutzung: 2 MB · GZIP: ein · Viewport: SMXL-HiDPI