View Issue Details

IDProjectCategoryView StatusLast Update
0029521FPCCompilerpublic2020-04-04 22:32
ReporterNitorami Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionunable to reproduce 
PlatformPCOSXP 
Product Version3.0.0 
Summary0029521: Internal Error 200306031 on absolute assignment and Level 2 optimisation on
DescriptionThis unit compiles without errors:

--------------------
unit FTA_Global;
INTERFACE

type TRandSource = object
         Q : array [0..$FF] of dword;
         function lfsr113 : dword ;
      end;

IMPLEMENTATION

function TRandSource.lfsr113: dword;
var b: dword;
    z: array [0..3] of dword absolute Q[0];
begin
end;

begin end.
------------------

However when modifying the function lfsr113 as below, the compiler generates an internal error 200306031 but only if optimisation Level 2 is active

function TRandSource.lfsr113: dword;
var b: dword;
    z: array [0..3] of dword absolute Q[0];
begin
  z[0] := z[0]+b;
end;

Steps To ReproduceCompile (text mode IDE)
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget-
Attached Files

Activities

Nitorami

2016-02-04 19:01

reporter  

Bi0T1N

2020-03-23 22:37

reporter   ~0121692

Last edited: 2020-03-23 22:38

View 3 revisions

Actually there are three different versions of your example but all compiling fine with FPC 3.3.1-r44326 and -O2/-O3

Warning: Function result does not seem to be set
Note: Local variable "b" not used
function TRandSource.lfsr113: dword;
var b: dword;
    z: array [0..3] of dword absolute Q[0];
begin
end;


Warning: Local variable "b" does not seem to be initialized
Warning: Function result does not seem to be set
function TRandSource.lfsr113: dword;
var b: dword;
    z: array [0..3] of dword absolute Q[0];
begin
  z[0] := z[0]+b;
end;


function TRandSource.lfsr113: dword;
var b: dword;
    z: array [0..4] of dword absolute Q[0];
begin
  b := 0;
  z[0] := z[0]+b;
  exit (0);
end;


Issue History

Date Modified Username Field Change
2016-01-27 21:45 Nitorami New Issue
2016-02-04 19:01 Nitorami File Added: IntError200306031.pas
2020-03-23 22:37 Bi0T1N Note Added: 0121692
2020-03-23 22:38 Bi0T1N Note Edited: 0121692 View Revisions
2020-03-23 22:38 Bi0T1N Note Edited: 0121692 View Revisions
2020-04-04 22:32 Florian Assigned To => Florian
2020-04-04 22:32 Florian Status new => resolved
2020-04-04 22:32 Florian Resolution open => unable to reproduce
2020-04-04 22:32 Florian FPCTarget => -