Merging gdc (GNU D Compiler) into gcc

Ian Lance Taylor
Tue Oct 4 23:11:00 GMT 2011

Iain Buclaw <> writes:

> On 4 October 2011 20:36, Andrew Pinski <> wrote:
>> On Tue, Oct 4, 2011 at 12:30 PM, Iain Buclaw <> wrote:
>>> These patches address two areas of the D language:
>>> 1) D calling convention.
>>> 2) Naked functions on i386 and x86_64
>>> Some work would need to be done on naked functions at least first so
>>> that changes required are only to gcc/config. I would be grateful if I
>>> could get pointed in the right direction for implementing naked as a
>>> function attribute for i386 so all frontends could benefit.
>> Does D really require a new calling convention?  Also does it really
>> require naked support?  I think naked support is a bad idea and people
>> who require naked support should be writing an assembly function
>> wrapper.
>> Thanks,
>> Andrew Pinski
> Naked functions are part of the D spec, and I would have to remove a
> few areas of the D runtime library if they were to go (I may get a
> number emails from D users too asking where it has gone).
> The D calling convention is one thing I can cope just fine without. It
> is needed more for use with some naked functions in the D runtime
> library.  The major quirk of the D ABI really is that routines will
> return floating point return values on the FPU stack, and expects this
> to be cleaned off by the caller, even if they are not used. I can
> instead fix the D runtime library if it is that much of a problem.

I don't personally have a problem with naked function support.  If it is
part of the D language I think it is reasonable to add it to gcc
backends.  This will presumably require some new target hook to see if
the functionality is available.

Using a different ABI for ordinary functions seem at first glance to be
a mistake, because it hurts interoperability with code not written in D.
I guess if this is implemented it would require some other target hook.


More information about the Gcc mailing list