Possible bug in the D compiler w.r.t x86_64 ABI calling convention

2012-05-19 Thread Sandeep Datta
Hi, I seem to have discovered a bug in the D compiler which is causing it to emit incompatible code with gcc on Ubuntu 11.04 x86_64. I have minimised the code required to reproduce this problem and uploaded it to github, here is the link https://github.com/SDX2000/CFromDTest1. Once you have

Re: Possible bug in the D compiler w.r.t x86_64 ABI calling convention

2012-05-19 Thread David Nadlinger
On Saturday, 19 May 2012 at 18:31:45 UTC, Sandeep Datta wrote: Please do let me know if this is a legitimate bug and if I need to file a bug report. x86_64 struct ABI differences are a known problem and being worked on, a fix will likely be included with the next release. David

Re: Possible bug in the D compiler w.r.t x86_64 ABI calling convention

2012-05-19 Thread Sandeep Datta
On Saturday, 19 May 2012 at 18:37:20 UTC, David Nadlinger wrote: On Saturday, 19 May 2012 at 18:31:45 UTC, Sandeep Datta wrote: Please do let me know if this is a legitimate bug and if I need to file a bug report. x86_64 struct ABI differences are a known problem and being worked on, a fix wi

Re: Possible bug in the D compiler w.r.t x86_64 ABI calling convention

2012-05-19 Thread Sandeep Datta
On Saturday, 19 May 2012 at 18:41:28 UTC, Sandeep Datta wrote: On Saturday, 19 May 2012 at 18:37:20 UTC, David Nadlinger wrote: On Saturday, 19 May 2012 at 18:31:45 UTC, Sandeep Datta wrote: Please do let me know if this is a legitimate bug and if I need to file a bug report. x86_64 struct AB

Re: Possible bug in the D compiler w.r.t x86_64 ABI calling convention

2012-05-20 Thread Jacob Carlborg
On 2012-05-19 20:42, Sandeep Datta wrote: Oops...hit send a little too early...I guess building with -m32 should fix this problem, no? Yes that will fix the problem. -- /Jacob Carlborg

Re: Possible bug in the D compiler w.r.t x86_64 ABI calling convention

2012-05-20 Thread Jacob Carlborg
On 2012-05-19 20:41, Sandeep Datta wrote: Hmm, are there any known work arounds? I am in a fix as I need to use the demios/libclang wrapper but it has several functions which return structs. There are bindings that are more up to date in my DStep project. It also contains some useful wrappers

Re: Possible bug in the D compiler w.r.t x86_64 ABI calling convention

2012-05-20 Thread Sandeep Datta
On Sunday, 20 May 2012 at 11:40:35 UTC, Jacob Carlborg wrote: On 2012-05-19 20:41, Sandeep Datta wrote: Hmm, are there any known work arounds? I am in a fix as I need to use the demios/libclang wrapper but it has several functions which return structs. There are bindings that are more up to

Re: Possible bug in the D compiler w.r.t x86_64 ABI calling convention

2012-05-20 Thread Jacob Carlborg
On 2012-05-20 19:00, Sandeep Datta wrote: Thanks but will your bindings work in 64bit mode? It seems to me some functions are still returning a struct. I think I will have to rebuild llvm+clang in 32bit, right? The bindings will work for both 32 and 64bit. It's impossible to change the bindin