View Issue Details

IDProjectCategoryView StatusLast Update
0032730FPCCompilerpublic2018-03-04 22:23
Reporterm_burkhard@gmx.chAssigned ToFlorian 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionunable to reproduce 
PlatformAVR25 (ATiny44A)OSLinux Mint 64BitOS Version18.2
Product Version3.1.1Product Build3.0.4rc1 
Target VersionFixed in Version 
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);
var
  i: byte;
begin
  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);
    end;
    PORTA := PORTA or (1 shl clockPin);
    PORTA := PORTA and not (1 shl clockPin);
  end;
end; [/code]
Additional InformationAttached the whole project.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

m_burkhard@gmx.ch

2017-11-25 21:06

reporter  

multiplex.tar.gz (10,337 bytes)

Florian

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?

m_burkhard@gmx.ch

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.

Florian

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 m_burkhard@gmx.ch New Issue
2017-11-25 21:06 m_burkhard@gmx.ch File Added: multiplex.tar.gz
2017-11-25 22:00 Florian Note Added: 0104269
2017-11-26 17:32 m_burkhard@gmx.ch 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