Thread overview
Patch to get GDC up to 1.028
Mar 07, 2008
downs
Mar 08, 2008
Leandro Lucarella
Mar 08, 2008
shinichiro.h
Mar 08, 2008
downs
March 07, 2008
This is a hastily cobbled together patch to bring GDC up to speed with DMD 1.028.

It was created by making a diff between .022 and .028 and applying it to the GDC .022 source.

In places where it failed, the respective files were more or less randomly prodded and pushed around until some semblance of working code emerged.

Luckily, I only had to completely blindly guess at *one* bit in the frontend glue code, so the amount of actual _compiler_ breakage should be small.

Phobos unittests _almost_ pass, except for some GC things which I can't figure out entirely. The GC seems to work okay though.

scrapple.tools and yawr managed to build without errors and run correctly, so I'm actually quite hopeful :)

Patch is attached^W^Wwould be attached, were it not for the server's size limit.

Instead, get it on http://demented.no-ip.org/~root/dgcc_1_022_to_1_028.patch

 --downs
March 08, 2008
downs, el  8 de marzo a las 00:21 me escribiste:
> This is a hastily cobbled together patch to bring GDC up to speed with DMD 1.028.
> 
> It was created by making a diff between .022 and .028 and applying it to the GDC .022 source.
> 
> In places where it failed, the respective files were more or less randomly prodded and pushed around until some semblance of working code emerged.
> 
> Luckily, I only had to completely blindly guess at *one* bit in the frontend glue code, so the amount of actual _compiler_ breakage should be small.
> 
> Phobos unittests _almost_ pass, except for some GC things which I can't figure out entirely. The GC seems to work okay though.
> 
> scrapple.tools and yawr managed to build without errors and run correctly, so I'm actually quite hopeful :)
> 
> Patch is attached^W^Wwould be attached, were it not for the server's size limit.
> 
> Instead, get it on http://demented.no-ip.org/~root/dgcc_1_022_to_1_028.patch

Nice work, thank you!

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Tired of lying in the sunshine staying home to watch the rain.
You are young and life is long and there is time to kill today.
And then one day you find ten years have got behind you.
No one told you when to run, you missed the starting gun.
March 08, 2008
Nice work!

I've also tried to make GDC use newer 2.*, but I've not done yet. By the way I found a bug in your patch. You are so careful that you are warning this can be a bug though.

http://d.puremagic.com/issues/show_bug.cgi?id=1575

breaks compiler like:

% gdc1 bug1575.d
TupleExp::toElem() tuple(_s_field_0 = _param_0,_s_field_1 = _param_1)
bug1575.d: In function 'foo':
bug1575.d:11: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
EXPER: Uneducated guesswork ensues. Beware.

I think removing TupleExp::toElem from expression.c and adding

elem *
TupleExp::toElem(IRState * irs)
{
    tree result = NULL_TREE;
    for (unsigned i = 0; i < exps->dim; i++) {
	Expression * e = (Expression *) exps->data[i];
	tree elem_e = e->toElem( irs );
	result = irs->maybeCompound(result, elem_e);
    }
    return result;
}

into d-glue.c will work.

Thanks,

At Sat, 08 Mar 2008 00:21:48 +0100,
downs wrote:
> 
> This is a hastily cobbled together patch to bring GDC up to speed with DMD 1.028.
> 
> It was created by making a diff between .022 and .028 and applying it to the GDC .022 source.
> 
> In places where it failed, the respective files were more or less randomly prodded and pushed around until some semblance of working code emerged.
> 
> Luckily, I only had to completely blindly guess at *one* bit in the frontend glue code, so the amount of actual _compiler_ breakage should be small.
> 
> Phobos unittests _almost_ pass, except for some GC things which I can't figure out entirely. The GC seems to work okay though.
> 
> scrapple.tools and yawr managed to build without errors and run correctly, so I'm actually quite hopeful :)
> 
> Patch is attached^W^Wwould be attached, were it not for the server's size limit.
> 
> Instead, get it on http://demented.no-ip.org/~root/dgcc_1_022_to_1_028.patch
> 
>  --downs

March 08, 2008
shinichiro.h wrote:
> Nice work!
> 
> I've also tried to make GDC use newer 2.*, but I've not done yet. By the way I found a bug in your patch. You are so careful that you are warning this can be a bug though.
> 
> http://d.puremagic.com/issues/show_bug.cgi?id=1575
> 
> breaks compiler like:
> 
> % gdc1 bug1575.d
> TupleExp::toElem() tuple(_s_field_0 = _param_0,_s_field_1 = _param_1)
> bug1575.d: In function 'foo':
> bug1575.d:11: internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
> EXPER: Uneducated guesswork ensues. Beware.
> 
> I think removing TupleExp::toElem from expression.c and adding
> 
> elem *
> TupleExp::toElem(IRState * irs)
> {
>     tree result = NULL_TREE;
>     for (unsigned i = 0; i < exps->dim; i++) {
> 	Expression * e = (Expression *) exps->data[i];
> 	tree elem_e = e->toElem( irs );
> 	result = irs->maybeCompound(result, elem_e);
>     }
>     return result;
> }
> 
> into d-glue.c will work.

Sweet, thanks!

I could never have gotten that - as I wrote, uneducated guesswork :)

I'll put it in the patch as soon as I can.

 --downs