View Issue Details

IDProjectCategoryView StatusLast Update
0032730FPCCompilerpublic2018-03-04 22:23 Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionunable to reproduce 
PlatformAVR25 (ATiny44A)OSLinux Mint 64Bit 
Product Version3.1.1 
Summary0032730: Code optimized incorrectly
DescriptionWith {$O-} everything io. , with {$O+} "val" is implemented. "val" changes constantly, but there is no change in shiftOut595.
Steps To Reproduce[code]{$O+}
procedure shiftOut595(val: byte);
  i: byte;
  for i := 7 downto 0 do begin
    if (val and (1 shl i)) <> 0 then begin
      PORTA := PORTA or (1 shl dataOutPin);
    end else begin
      PORTA := PORTA and not (1 shl dataOutPin);
    PORTA := PORTA or (1 shl clockPin);
    PORTA := PORTA and not (1 shl clockPin);
end; [/code]
Additional InformationAttached the whole project.
TagsNo tags attached.
Fixed in Revision
Attached Files


2017-11-25 21:06


multiplex.tar.gz (10,337 bytes)


2017-11-25 22:00

administrator   ~0104269

I tried to find a problem in the generated assembler of the mentioned procedure, but I cannot find one. Do you use latest trunk?

2017-11-26 17:32

reporter   ~0104292

I created the trunk of FPC and Lazarus the same day with fpcupdelux. The FPC version 3.0.4rc1 instead of 3.1.1, I was also surprised.
I wanted to have the latest version to create a bug report.


2018-03-04 22:23

administrator   ~0106870

Please re-open if it is still reproducable with trunk.

Issue History

Date Modified Username Field Change
2017-11-25 21:06 New Issue
2017-11-25 21:06 File Added: multiplex.tar.gz
2017-11-25 22:00 Florian Note Added: 0104269
2017-11-26 17:32 Note Added: 0104292
2018-03-04 22:23 Florian Note Added: 0106870
2018-03-04 22:23 Florian Status new => resolved
2018-03-04 22:23 Florian Resolution open => unable to reproduce
2018-03-04 22:23 Florian Assigned To => Florian