Bug 1398 – GDC doesn't generate correct code

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2007-08-03T22:16:00Z
Last change time
2015-06-09T05:15:19Z
Assigned to
dvdfrdmn
Creator
mariusmuja

Comments

Comment #0 by mariusmuja — 2007-08-03T22:16:14Z
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.
Comment #1 by dvdfrdmn — 2007-08-05T12:22:53Z
Fixed svn r138
Comment #2 by thomas-dloop — 2008-02-25T05:05:18Z