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 downloaded it run build to generate the executables. You'll see that the output produced by the d program is different from the output produced by the equivalent c code. I have spent some time on analysing the generated assembly. You'll find annotated assembly code main.d etc highlighting the problem.

Basically the problem is that dmd generates code which is not compatible with gcc when a C function returns a struct.

Please do let me know if this is a legitimate bug and if I need to file a bug report.

Regards,
Sandeep Datta.

Reply via email to