View Issue Details

IDProjectCategoryView StatusLast Update
0034316FPCOtherpublic2019-12-28 09:33
Reportersilvioprog Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionunable to reproduce 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0034316: Error: undefined reference to `.Lj9'
DescriptionHi.

The attached code compiles fine in FPC 3.0.4 for Windows and in Delphi Tokyo, but it fails in latest (from trunk) FPC for Linux at linking time:

Compile Project, Target: test: Exit code 256, Errors: 1
Free Pascal Compiler version 3.1.1 [2018/09/05] for x86_64
Copyright (c) 1993-2018 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling test.dpr
Linking bug/test
bug/lib/x86_64-linux/test.o: In function `BAR':
bug//test.dpr:25: undefined reference to `.Lj9'
test.dpr(31,1) Error: Error while linking
Steps To ReproduceJust download and try to compile the attached test in FPC on Linux x86_64.
Additional InformationEnvironment: Free Pascal Compiler version 3.1.1 [2018/09/05] for x86_64.

It shows 3.1.1 but it was compiled from trunk. Mantis doesn't provide the 3.1.1 option, so I chose 3.3.1.
Tagsgenerics
Fixed in Revision42987
FPCOldBugId
FPCTarget-
Attached Files

Relationships

related to 0035877 closedJonas Maebe Trunk compiler fails with 200510032 

Activities

silvioprog

2018-09-21 05:29

reporter  

bug.tar.gz (1,172 bytes)

silvioprog

2018-09-21 05:29

reporter  

bug.tar.gz.sig (310 bytes)

Do-wan Kim

2018-09-21 07:08

reporter   ~0110916

Last edited: 2018-09-21 07:15

View 3 revisions

I also got error under windows.

Hint: (11030) Start of reading config file C:\development\fpc\bin\i386-win32\fpc.cfg
Hint: (11031) End of reading config file C:\development\fpc\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 3.3.1-r39771 [2018/09/20] for x86_64
Copyright (c) 1993-2018 by Florian Klaempfl and others
(1002) Target OS: Win64 for x64
(3104) Compiling test.dpr
test.dpr(25,13) Fatal: Internal error 200312011
Fatal: (1018) Compilation aborted
Error: C:\development\fpc\bin\i386-win32\ppcrossx64.exe returned an error exitcode



Hint: (11030) Start of reading config file C:\development\fpc\bin\i386-win32\fpc.cfg
Hint: (11031) End of reading config file C:\development\fpc\bin\i386-win32\fpc.cfg
Free Pascal Compiler version 3.3.1-r39771 [2018/09/20] for i386
Copyright (c) 1993-2018 by Florian Klaempfl and others
(1002) Target OS: Win32 for i386
(3104) Compiling test.dpr
test.dpr(25,13) Fatal: Internal error 200312011
Fatal: (1018) Compilation aborted
Error: C:\development\fpc\bin\i386-win32\ppc386.exe returned an error exitcode

compiler works when changed on ubar.pas

  TBar = class
  private
    function GetArr: TArray<string>; //inline;
  public
    property Arr: TArray<string> read GetArr;
  end;

Sven Barth

2018-09-21 17:35

manager   ~0110932

The problematic clause appears to be the raise-statement in the Check() method. If that method is not inlined it also compiles without error (at least on i386-win32).

Marco van de Voort

2018-09-22 13:34

manager   ~0110951

While it remains a bug of course (FPC should warn if it can't inline, and IE's are always errors ), the code is also a bit strange.

Usually when raising an exception is moved to a separate procedure/method it is to avoid the generation of an exception frame. Inlining it this way pulls the exception frame generation into all users of getarr.

So removing the inline from check would be a good thing probably, even if the bug didn't exist.

Sven Barth

2018-09-22 22:37

manager   ~0110961

It's not the raise-statement that leads to the generation of an exception frame, but the presence of a variable that is of a managed type and of which the compiler changes the reference count (and thus needs to be undone always) and the compiler not knowing whether any executed code might raise an exception (this is even the case without any calls as the instructions themselves might trigger exception (access violation, div by 0, floating point, etc.)). Why do you think the compiler itself is compiled with "$ImplicitExceptions Off"? ;)

Florian

2019-12-26 22:46

administrator   ~0120078

Works meanwhile apparently.

Sven Barth

2019-12-28 09:33

manager   ~0120095

Found the revision that fixed it: r42987. :)

Issue History

Date Modified Username Field Change
2018-09-21 05:29 silvioprog New Issue
2018-09-21 05:29 silvioprog File Added: bug.tar.gz
2018-09-21 05:29 silvioprog File Added: bug.tar.gz.sig
2018-09-21 06:24 Cyrax Tag Attached: generics
2018-09-21 07:08 Do-wan Kim Note Added: 0110916
2018-09-21 07:14 Do-wan Kim Note Edited: 0110916 View Revisions
2018-09-21 07:15 Do-wan Kim Note Edited: 0110916 View Revisions
2018-09-21 17:35 Sven Barth Note Added: 0110932
2018-09-22 13:34 Marco van de Voort Note Added: 0110951
2018-09-22 22:37 Sven Barth Note Added: 0110961
2019-12-26 22:46 Florian Assigned To => Florian
2019-12-26 22:46 Florian Status new => resolved
2019-12-26 22:46 Florian Resolution open => unable to reproduce
2019-12-26 22:46 Florian Fixed in Version => 3.3.1
2019-12-26 22:46 Florian FPCTarget => -
2019-12-26 22:46 Florian Note Added: 0120078
2019-12-28 09:32 Sven Barth Fixed in Revision => 42987
2019-12-28 09:32 Sven Barth Relationship added related to 0035877
2019-12-28 09:32 Sven Barth Relationship deleted related to 0035877
2019-12-28 09:33 Sven Barth Fixed in Revision 42987 =>
2019-12-28 09:33 Sven Barth Fixed in Revision => 42987
2019-12-28 09:33 Sven Barth Note Added: 0120095
2019-12-28 09:33 Sven Barth Relationship added related to 0035877