Latest SVN version of GDC (r137) doesn't generate the correct code for the following program:
class B
{
private A[] ab;
}
class A
{
private A[] aa;
void bar()
{
aa = new A[10];
assert(aa.length == 10);
}
}
void main()
{
A a = new A;
a.bar();
}
For the above program not code is generated for the line aa = new A[10]; and when ran the program terminated with an assertion failure which is obviously incorrect. I get this behavior when I use gcc-4.1.2 from Gentoo with the default gcc patches included in the gcc-4.1.2 ebuild. When I manually compile GDC (r137) with gcc-4.1.2 without the other patches I get the following compiler crash:
test.d: In member function âbarâ:
test.d:15: internal compiler error: in gimplify_expr, at gimplify.c:4680
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.