View Issue Details

IDProjectCategoryView StatusLast Update
0038114FPCCompilerpublic2020-11-22 13:28
ReporterOkobaPatino Assigned To 
Status newResolutionopen 
Summary0038114: Inlining cast managed typed to unmanaged
DescriptionCurrently, the compiler can not inline calling functions like Test2, and it needs to make separate variants for each param to enable inlining.

program Project1;
  function Test1(A: PChar): PChar; inline;
    Result := A + 1;
  S: String;
  P: PChar;
  S := 'Test';
  P := Pointer(S); //Inlined
  P := Test1(P);
  P := Test1(Pointer(S)); //Not inlined
TagsNo tags attached.
Fixed in Revision
Attached Files


Jonas Maebe

2020-11-22 13:15

manager   ~0127096

Last edited: 2020-11-22 13:16

View 2 revisions

There is no need to file bug reports about such cases. The default is "inline if the inline modifier is used", and then there are a bunch of cases that are excluded because the compiler currently cannot handle them.


2020-11-22 13:28

reporter   ~0127098

I wanted something to monitor so when it is fixed; it can be possible to clean the code from many useless variants like the Test1 case.
Otherwise, it will be needed to check once in a while that if the compiler inlines this or not.

Issue History

Date Modified Username Field Change
2020-11-22 13:05 OkobaPatino New Issue
2020-11-22 13:15 Jonas Maebe Note Added: 0127096
2020-11-22 13:16 Jonas Maebe Note Edited: 0127096 View Revisions
2020-11-22 13:28 OkobaPatino Note Added: 0127098