GDC does.

Sean Kelly sean at invisibleduck.org
Mon May 19 08:46:11 PDT 2008


== Quote from downs (default_357-line at yahoo.de)'s article
> Bill Baxter wrote:
> > Sadly, I believe what I have heard mentioned here on the NG is that DMD
> > does *not* currently inline *any* functions that have ref args.  Which
> > is a serious problem, since performance is one reason you would switch
> > to ref args in the first place.  (To avoid passing large structs by value.)
> >
> FWIW, GDC does inline ref-arg functions.
> Proof:
> gentoo-pc ~ $ cat test42.d && echo "----" && gdc test42.d -o test42 -O3 -frelease && ./test42
> module test42;
> import std.stdio;
> void test() {
>   void* foo; asm { mov foo, ESP; }
>   writefln("SP: ", foo);
> }
> void rtest(ref int x) { x++; test(); }
> void main() {
>   int i = 0;
>   test();
>   rtest(i);
> }
> ----
> SP: BFC57840
> SP: BFC57840

It apparently inlines functions containing asm blocks as well.  Score
two points for GDC.


Sean



More information about the Digitalmars-d mailing list