Undefined _D10TypeInfo_l6__initZ and _D15TypeInfo_Struct6__vtblZ added when instantiating template structs

2015-01-26 Thread Liran Zvibel via D.gnu
Hi, I would like to use some D code in a C binary . Part of the D functionality used is by instantiating templated structs. Even if I just try to compile the following simple code: extern (C) { alias mytpye = BLA!(int); struct BLA(T) { T x; } } With the following gcd flag

Re: Undefined _D10TypeInfo_l6__initZ and _D15TypeInfo_Struct6__vtblZ added when instantiating template structs

2015-02-18 Thread Liran Zvibel via D.gnu
On Monday, 26 January 2015 at 23:21:23 UTC, Mike wrote: If you're compliling with -nophoboslib, you are also compiling without the runtime, not just phobos. GDC compiles them in one library, IIRC. Therefore, you have to implement those parts of the runtime the compiler inserts implicitly.

Using static immutable Exceptions (or other way for NON-GC exceptions)

2015-02-18 Thread Liran Zvibel via D.gnu
Hi, We would like to use exceptions in some cases, but we don't want to allocate them when we send them. What we do with dmd is create bunch of "static immutable Throwable" members in our objects during creation (for every possible case), then we just throw these members in the code. When co

Re: Using static immutable Exceptions (or other way for NON-GC exceptions)

2015-02-18 Thread Liran Zvibel via D.gnu
On Wednesday, 18 February 2015 at 13:07:12 UTC, Iain Buclaw wrote: It may be a better solution to have a static TLS pointer that gets new'd upon thread start. Perhaps even make it a pre-allocated array so we might be able to get chained exceptions working in GDC runtime. Iain I like the id

Re: Using static immutable Exceptions (or other way for NON-GC exceptions)

2015-02-18 Thread Liran Zvibel via D.gnu
On Wednesday, 18 February 2015 at 14:59:19 UTC, Iain Buclaw wrote: Yah. The only gotcha is if you fill up the chain, and it needs to realloc/grow the memory. Would only ever happen if you have deep levels of try { } catch(e) { throw e; } though Iain It could be a gcd compile time para

GDC generates invalid assembly around fiber yield operations (Not re-reading data from clobberedd memory to registers)

2015-05-03 Thread Liran Zvibel via D.gnu
Hi, We are trying to port a large fiber based application to GDC. Our application works well when compiled with DMD with optimizations. It fails very quickly with GDC (even before we tried optimizations), and we were able to narrow it to how GDC treats yields. Please look at the following sm

Re: GDC generates invalid assembly around fiber yield operations (Not re-reading data from clobberedd memory to registers)

2015-05-05 Thread Liran Zvibel via D.gnu
Hi, Another thing that I noticed about this issue, is that in this isolated test case, the problem only happens if the added value is returned from the function that performs the 'yield()'. If I call 'yield()' directly, then add to 'globalSum', or if I just call 'otherFunc()', ignore the retur

Re: GDC generates invalid assembly around fiber yield operations (Not re-reading data from clobberedd memory to registers)

2015-05-14 Thread Liran Zvibel via D.gnu
Hi, I forgot to mention is before, I'm running with GDC commit b022dd4cac195d85e9c3a6a37f2501a07ade455a from April 7th based on GCC 4.9. Does anyone have experience compiling (and then running) Fiber based applications with GDC? What are you doing? Is there a plan to add support for @attri

Re: GDC generates invalid assembly around fiber yield operations (Not re-reading data from clobberedd memory to registers)

2015-05-15 Thread Liran Zvibel via D.gnu
Hi, I’m trying to port a 120k loc fiber based application from dmd to gdc, so applying this work around is not a good option for me (also, there are many engineers that will continue generating code…) Thanks Liran > On May 15, 2015, at 10:08, Johannes Pfau via D.gnu > wrote: > > Am Thu, 14 Ma

Re: GDC generates invalid assembly around fiber yield operations (Not re-reading data from clobberedd memory to registers)

2015-05-15 Thread Liran Zvibel via D.gnu
Please feel free to use my code sample in the test suite. I fill post a bug report. Thanks! Liran > On May 15, 2015, at 10:23, Iain Buclaw via D.gnu wrote: > > On 15 May 2015 at 09:13, Iain Buclaw wrote: >> On 15 May 2015 at 09:08, Johannes Pfau via D.gnu wrote: >>> Am Thu, 14 May 2015 19:02