www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - DMD 0.127: Strange bug causing compiler crash

reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Minimalized test case below. It gives me:
"Internal error: ..\ztc\cod2.c 4211"

--

struct Foo { ubyte a, b, c; }

int main() {
	Foo d;
	foobar(d);
	return 0;
}

void foobar(Foo e) {}

--

Why I think this is particularly strange?
	* A function taking a Foo, in this case foobar(), is necessary -
without one, the code compiles.
	* If the number of ubytes is increased or decreased, the code compiles
- there must be specifically three.
	* The crash requires that the variable types be one of: bit, byte,
char, ubyte - anything 8-bit or smaller. I admit I didn't try all
variable types, but I hopped around the range of types sufficiently to
make me believe that those are the only ones.

I'm fairly sure I'm not doing anything wrong in the code, but even if I
am I'd like a more descriptive error message ;-)
Jul 07 2005
parent Thomas Kuehne <thomas-dloop kuehne.this-is-spam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Deewiant schrieb am Thu, 07 Jul 2005 20:02:37 +0300:
 Minimalized test case below. It gives me:
 "Internal error: ..\ztc\cod2.c 4211"

 --

 struct Foo { ubyte a, b, c; }

 int main() {
 	Foo d;
 	foobar(d);
 	return 0;
 }

 void foobar(Foo e) {}

 --

 Why I think this is particularly strange?
 	* A function taking a Foo, in this case foobar(), is necessary -
 without one, the code compiles.
 	* If the number of ubytes is increased or decreased, the code compiles
 - there must be specifically three.
 	* The crash requires that the variable types be one of: bit, byte,
 char, ubyte - anything 8-bit or smaller. I admit I didn't try all
 variable types, but I hopped around the range of types sufficiently to
 make me believe that those are the only ones.

 I'm fairly sure I'm not doing anything wrong in the code, but even if I
 am I'd like a more descriptive error message ;-)
Added to DStress as http://dstress.kuehne.cn/run/b/bug_cod2_4211_A.d http://dstress.kuehne.cn/run/b/bug_cod2_4211_B.d http://dstress.kuehne.cn/run/b/bug_cod2_4211_C.d http://dstress.kuehne.cn/run/b/bug_cod2_4211_D.d http://dstress.kuehne.cn/run/b/bug_cod2_4211_E.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCzWsY3w+/yD4P9tIRAsF2AJ9cQgeVFEi99cVaO/WddbhRv6BlVACggmSu KAVfUWTog7YiXC3sCJyFLeU= =H/r6 -----END PGP SIGNATURE-----
Jul 07 2005