build gdc with gcc 4.2.2
Arthur Loiret
arthur.loiret at gmail.com
Sat Nov 24 09:03:48 PST 2007
Hi Ingo,
On Sat, Nov 24, 2007 at 03:13:52PM +0100, Ingo Oeser wrote:
> > --- gcc/tree.h 2007-11-15 14:21:01.000000000 +0100
> > +++ gcc/tree.h 2007-11-15 14:22:05.000000000 +0100
> > @@ -3535,6 +3535,19 @@
> >
> > extern tree build_nt (enum tree_code, ...);
> >
> > +/* Still required by gdc */
> > +#if GCC_VERSION >= 3000 || __STDC_VERSION__ >= 199901L
> > +/* Use preprocessor trickery to map "build" to "buildN" where N is the
> > + expected number of arguments. This is used for both efficiency (no
> > + varargs), and checking (verifying number of passed arguments). */
> > +#define build(code, ...) \
> > + _buildN1(build, _buildC1(__VA_ARGS__))(code, __VA_ARGS__)
> > +#define _buildN1(BASE, X) _buildN2(BASE, X)
> > +#define _buildN2(BASE, X) BASE##X
> > +#define _buildC1(...)
> > _buildC2(__VA_ARGS__,9,8,7,6,5,4,3,2,1,0,0) +#define
> > _buildC2(x,a1,a2,a3,a4,a5,a6,a7,a8,a9,c,...) c +#endif
> > +
> > extern tree build0_stat (enum tree_code, tree MEM_STAT_DECL);
> > #define build0(c,t) build0_stat (c,t MEM_STAT_INFO)
> > extern tree build1_stat (enum tree_code, tree, tree MEM_STAT_DECL);
>
> That's more (short term) maintainable than my approach. I patched the D glue
> layer, fixed up the callers and provided build2() and build3() for compilers
> below GCC 4.0.x.
You're right. :-)
> > I'm currently trying to fix ICEs, the problems seems to come from
> > gimple.
>
> Yes, I have seen the same and my vacation was over, so I stopped it.
I made a few other temporary patches to fix ICEs, here is what changed:
diff -ruN gcc/gimplify.c gcc/gimplify.c
--- gcc/gimplify.c 2007-11-19 11:56:50.000000000 +0000
+++ gcc/gimplify.c 2007-11-19 11:58:32.000000000 +0000
@@ -1804,12 +1804,16 @@
/* Divide the offset by its alignment. */
offset = size_binop (EXACT_DIV_EXPR, offset, factor);
- if (!is_gimple_min_invariant (offset))
- {
- TREE_OPERAND (t, 2) = offset;
- tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p, post_p,
- is_gimple_formal_tmp_reg, fb_rvalue);
- ret = MIN (ret, tret);
+ /* Would be better to have a look at size_binop ... */
+ if (offset != NULL_TREE)
+ {
+ if (!is_gimple_min_invariant (offset))
+ {
+ TREE_OPERAND (t, 2) = offset;
+ tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p, post_p,
+ is_gimple_formal_tmp_reg, fb_rvalue);
+ ret = MIN (ret, tret);
+ }
}
}
}
diff -ruN gcc/tree-inline.c gcc/tree-inline.c
--- gcc/tree-inline.c 2007-11-19 15:41:33.000000000 +0000
+++ gcc/tree-inline.c 2007-11-19 15:42:24.000000000 +0000
@@ -2636,8 +2636,9 @@
{
tree copy, type;
- gcc_assert (TREE_CODE (decl) == PARM_DECL
- || TREE_CODE (decl) == RESULT_DECL);
+ if (cfun->naked) /* Not sure this is right ... */
+ gcc_assert (TREE_CODE (decl) == PARM_DECL
+ || TREE_CODE (decl) == RESULT_DECL);
type = TREE_TYPE (decl);
gdc-4.2 now builds phobos and tango, see [0] and [1].
[0] http://packages.qa.debian.org/g/gdc-4.2.html
[1] http://people.dunnewind.net/arthur/gdc-4.2/
Here is how to test it:
1/ Add this to your /etc/apt/sources.list
deb http://ftp.fr.debian.org/debian experimental main
deb-src http://ftp.fr.debian.org/debian experimental main
2/ Run sudo aptitude update && sudo aptitude install gdc-4.2
I've cleanup gdc-4.2-build.dpatch: see:
http://people.dunnewind.net/arthur/gdc-4.2/patches/gdc-4.2-build.dpatch
David, could you also have a look at this one?
> I have some questions for some parts of that patch. I'll mail them to you.
Sure, no problem.
Have a nice day,
Arthur.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.puremagic.com/pipermail/d.gnu/attachments/20071124/7e7375e7/attachment.pgp
More information about the D.gnu
mailing list