View Issue Details

IDProjectCategoryView StatusLast Update
0036242FPCCompilerpublic2019-12-07 18:06
ReporterChristo CrauseAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version3.3.1Product Build43344 
Target VersionFixed in Version 
Summary0036242: AVR - compiler gets stuck in trgobj.do_register_allocation
DescriptionWhen compiling the example below with -O2 the compiler gets stuck in trgobj.do_register_allocation. This is probably related to Florian's comment (https://bugs.freepascal.org/view.php?id=36236#c118946) about problems with the register allocator, AVR register orthogonality and spilling of registers.
Steps To ReproduceCompile program below with following compiler arguments:
ppcrosavr -Cpavr5 -Tembedded -Wpatmega328p -Pavr -XPavr- -O2 test.pp

program test;

function fpc_qword: qword;
var
  n: boolean;
  bitpos: qword;
begin
  fpc_qword := 0;
  bitpos := 0;

  for n := false to true do
    bitpos := bitpos + bitpos;
end;

begin
end.
TagsAVR
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

Florian

2019-11-01 20:18

administrator   ~0118955

Actually, if you wait long enough (centuries :))?, you get an internalerror. I am not sure though why the register allocator does not find a solution in this case, as far as I can see, the non-orthogonal register set is not the problem.

Christo Crause

2019-12-07 18:06

reporter   ~0119683

Note that a different user is experiencing a similar issue, refer to discussion on Lazarus forum: https://forum.lazarus.freepascal.org/index.php/topic,47649.0.html

Issue History

Date Modified Username Field Change
2019-11-01 17:17 Christo Crause New Issue
2019-11-01 17:18 Christo Crause Tag Attached: AVR
2019-11-01 20:18 Florian Note Added: 0118955
2019-12-07 18:06 Christo Crause Note Added: 0119683