View Issue Details

IDProjectCategoryView StatusLast Update
0029899FPCCompilerpublic2020-05-21 08:30
ReporterStefan Berinde Assigned ToPierre Muller  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformAMD64OSWin 
Product Version3.0.0 
Fixed in Version3.1.1 
Summary0029899: Fatal: Internal error 2012010601
DescriptionCompiling a trivial unit with "-gch" options will trigger a fatal error at compile time. It is something related with pointer checks in a unit.
Steps To ReproduceCompile unit:

----------------------
unit bug;

interface

implementation

var a: ^longword;
   
initialization
  New(a);
  a^:=0; // <- line 11
end.
----------------------

Compiler output:

----------------------
d:\Research\Coding\bug>fpc bug.pas -gch
Free Pascal Compiler version 3.0.0 [2015/11/16] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling bug.pas
bug.pas(11,4) Fatal: Internal error 2012010601
Fatal: Compilation aborted
Error: C:\Software\FPC\bin\i386-Win32\ppc386.exe returned an error exitcode
----------------------
Additional InformationIf the code is moved to a program it compiles without error.
TagsNo tags attached.
Fixed in Revision34261
FPCOldBugId
FPCTarget
Attached Files

Activities

Jonas Maebe

2016-03-25 22:20

manager   ~0091404

Sorry, closed wrong bug report (was intended for 0029892)

Stefan Berinde

2017-06-16 18:08

reporter   ~0101191

I reopened this report since the bug occurs with the last version of the compiler 3.0.2. Compiling the same unit I got:

d:\Research\Coding\bug>fpc bug.pas -gch
Free Pascal Compiler version 3.0.2 [2017/02/13] for i386
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling bug.pas
bug.pas(11,4) Fatal: Internal error 2012010601
Fatal: Compilation aborted
Error: C:\Software\FPC\bin\i386-Win32\ppc386.exe returned an error exitcode

Jonas Maebe

2017-06-16 21:47

manager   ~0101196

This was fixed in FPC 3.1.1. This fix has not been merged back to FPC 3.0.x.

JernejL

2020-05-21 08:30

reporter   ~0122971

Looks like 3.2.0 has a regression for this bug, as this still occurs in 3.2.0.
 
My forum thread about this: https://forum.lazarus.freepascal.org/index.php/topic,38404.msg362833.html#msg362833
 
It happens when pointers are compared when pointers are of different type - even if i cast them to a int with ptruint for example.

Issue History

Date Modified Username Field Change
2016-03-25 16:18 Stefan Berinde New Issue
2016-03-25 22:18 Jonas Maebe Relationship added duplicate of 0009262
2016-03-25 22:18 Jonas Maebe Status new => resolved
2016-03-25 22:18 Jonas Maebe Resolution open => duplicate
2016-03-25 22:18 Jonas Maebe Assigned To => Jonas Maebe
2016-03-25 22:20 Jonas Maebe Relationship deleted 0009262
2016-03-25 22:20 Jonas Maebe Note Added: 0091404
2016-03-25 22:20 Jonas Maebe Assigned To Jonas Maebe =>
2016-03-25 22:20 Jonas Maebe Status resolved => new
2016-03-25 22:20 Jonas Maebe Resolution duplicate => open
2016-08-29 23:03 Jonas Maebe Fixed in Revision => 34261
2016-08-29 23:03 Jonas Maebe Status new => resolved
2016-08-29 23:03 Jonas Maebe Fixed in Version => 3.1.1
2016-08-29 23:03 Jonas Maebe Resolution open => fixed
2016-08-29 23:03 Jonas Maebe Assigned To => Pierre Muller
2017-06-16 18:08 Stefan Berinde Note Added: 0101191
2017-06-16 18:08 Stefan Berinde Status resolved => feedback
2017-06-16 18:08 Stefan Berinde Resolution fixed => reopened
2017-06-16 21:47 Jonas Maebe Note Added: 0101196
2017-06-16 21:47 Jonas Maebe Status feedback => resolved
2017-06-16 21:47 Jonas Maebe Resolution reopened => fixed
2020-05-21 08:30 JernejL Note Added: 0122971