Can we drop static struct initializers?

Walter Bright newshound1 at digitalmars.com
Fri Nov 20 02:36:12 PST 2009


bearophile wrote:
> I've used static struct initializers because somehow the dmd
> optimizer is able to produce more efficient code. If you replace the
> C-style static struct initializers in this program with D ones (the
> ones like Foo(1, 2)) the program gets slower: 
> http://shootout.alioth.debian.org/debian/benchmark.php?test=nbody&lang=gdc&id=1
> 
> 
> Maybe dmd doesn't see D-style static struct initializers as true
> compile-time constants, I don't know. I think LDC doesn't share this
> problem/limit.


The generated code should be identical. Please file a bugzilla!



More information about the Digitalmars-d mailing list