Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 120 - Inlining of some functions fails (arrays with qualified element types)
Summary: Inlining of some functions fails (arrays with qualified element types)
Status: RESOLVED WORKSFORME
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: All All
: --- normal
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2014-04-15 15:04 CEST by Johannes Pfau
Modified: 2014-07-12 19:18 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Pfau 2014-04-15 15:04:33 CEST
----------------------
import gcc.attribute;
import std.stdio;

void main()
{
    int[] arr = [1,2,3];
    testArr(arr);
}

 
@attribute("forceinline") void testArr(const(int)[] a)
{
    writeln(a);
}
----------------------
/opt/gdc/bin/gdc test.d -finline -O1 -S
test.d:11: error: inlining failed in call to always_inline 'testArr': mismatched arguments

http://forum.dlang.org/thread/mailman.75.1396605155.19942.d.gnu@puremagic.com
Comment 1 Ketmar Dark 2014-04-18 12:53:56 CEST
(In reply to Johannes Pfau from comment #0)

seems to be fixed in recent commits (or never appears with gcc-4.9). i'm using gcc-4.9 on x86 (built from snapshot from 17 apr) and gdc git from 15 apr, everything works ok and the code was correctly inlined (i checked this with objdump disassembly).
Comment 2 Iain Buclaw 2014-04-18 16:44:44 CEST
It is still present.
Comment 3 Ketmar Dark 2014-04-18 16:54:42 CEST
(In reply to Iain Buclaw from comment #2)
> It is still present.
can't reproduce though. maybe this due to the fact i built gdc with --enable-checks=release.
Comment 4 Johannes Pfau 2014-07-12 19:18:11 CEST
Can't reproduce anymore.