Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Generics    [ Add a report in this area ]  
Report #:  121336   Status: Closed
[XE5 REGRESSION] Generic method inlining (Part 3)
Project:  Delphi Build #:  19.0.14356.6604
Version:    19.0 Submitted By:   Blaise Thorn
Report Type:  Basic functionality failure Date Reported:  12/22/2013 10:55:58 PM
Severity:    Serious / Highly visible problem Last Updated: 4/15/2014 6:34:25 PM
Platform:    All platforms Internal Tracking #:   46290
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 40
Description
A third case where INLINE generic methods are no longer inlined.

This is a regression happened in Delphi XE5.

This is a follow-up to QC 118815 / RS 43477.
Steps to Reproduce:
See the attached test case.
NB: ALWAYS REBUILD. If Lib.dcu is already present, DCC manages to inline everything as expected. But, since there are no cycles in USES, DCC must be able to inline even during a rebuild.
Expected output (as seen with XE4):
PASS: #0
PASS: #1
PASS: #2
PASS: #3
Actual output (since XE5):
PASS: #0
FAIL: #1
FAIL: #2
PASS: #3

Here are the key excerpts from the test case:
----------8<----------
function G<T>.NotInlined: PT; inline;
begin

result := OwnField
end;

function Tester.Inlined: Integer; inline;
begin

result := F.NotInlined()^
end;

// Here, "Inlined" is inlined,
//   but "NotInlined" is not inlined inside it:
T.Inlined();
----------8<----------
Workarounds
None
Attachment
qc121336.zip
Comments

None

Server Response from: ETNACODE01