View Issue Details

IDProjectCategoryView StatusLast Update
0037465FPCCompilerpublic2020-08-23 13:28
ReporterFrederic Assigned ToJonas Maebe  
Status resolvedResolutionfixed 
Product Version3.2.0 
Fixed in Version3.3.1 
Summary0037465: Out Parameter referencing char of string not set when inlineing the function
DescriptionWhen a char of a string is used as out parameter for an inline function (or var parameter) then the function will simply not set the result, i.e. the write operations are discarded
Steps To ReproduceSee example
TagsNo tags attached.
Fixed in Revision37465
Attached Files



2020-08-01 19:47


example.pas (172 bytes)   
program example;

{$mode objfpc}{$H+}

procedure foo(out c: char); inline;
  c := #32;

var s: String;


example.pas (172 bytes)   

jamie philbrook

2020-08-01 21:02

reporter   ~0124471

Yes, you are correct 3.2.0 is generating non working code, it's also generating more code over what 3.0.4 for this operation.

 I looked at the ASM code and it is non working code with inline..

 Also.. I wanted to thank you for putting this report here because I have an app that has DLL's and when using 3.2.0 the DLL's become fatter and slower and I get bad data where as they work using 3.0.4.

   It just so happens that I do have some operations INLINED like this using strings and static type arrays and with the errors I am getting it kind of points to what you found.

 Thank You.

Issue History

Date Modified Username Field Change
2020-08-01 19:47 Frederic New Issue
2020-08-01 19:47 Frederic File Added: example.pas
2020-08-01 21:02 jamie philbrook Note Added: 0124471
2020-08-23 13:28 Jonas Maebe Assigned To => Jonas Maebe
2020-08-23 13:28 Jonas Maebe Status new => resolved
2020-08-23 13:28 Jonas Maebe Resolution open => fixed
2020-08-23 13:28 Jonas Maebe Fixed in Version => 3.3.1
2020-08-23 13:28 Jonas Maebe Fixed in Revision => 37465
2020-08-23 13:28 Jonas Maebe FPCTarget => 3.2.2