www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - error in /ztc/elfobj.c 1251

reply Ben Hinkle <bhinkle4 juno.com> writes:
Compiling

bool foo() {
  int x;
  for (;;) {
    if (x == 0)
      return true;
    x = 1;
  }
  return false;
}

int main() {
  foo();
  return 0;
}

[locks]$ dmd -g test.d
Internal error: ../ztc/elfobj.c 1251

A related issue reported by Jan Bendtsen on the main newsgroup had a
workaround so I'll probably be able to work around it but currently it
means the Locks library doesn't compile. Glancing over the code it uses
early returns pretty often so hopefully the workaround will be small.

-Ben
Dec 08 2004
next sibling parent Ben Hinkle <bhinkle4 juno.com> writes:
I should say it only happens on linux (hence the elf, I suppose). Windows
compiles Locks just fine.
Dec 08 2004
prev sibling parent reply Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Added to DStress as
http://svn.kuehne.cn/dstress/run/bug_elfobj_1251_A.d
http://svn.kuehne.cn/dstress/run/bug_elfobj_1251_B.d

Thomas

Ben Hinkle schrieb am Wed, 08 Dec 2004 19:35:43 -0500:
 Compiling

 bool foo() {
   int x;
   for (;;) {
     if (x == 0)
       return true;
     x = 1;
   }
   return false;
 }

 int main() {
   foo();
   return 0;
 }

 [locks]$ dmd -g test.d
 Internal error: ../ztc/elfobj.c 1251
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.9.13 (GNU/Linux) iD8DBQFBt8bn3w+/yD4P9tIRAr0jAKCZgj6ggEszNZqEVQ1zZOHEXEHKpACgunVD Neqea07++Zdv34ey0zUzT+A= =+vpg -----END PGP SIGNATURE-----
Dec 08 2004
parent Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas Kuehne schrieb am Thu, 9 Dec 2004 04:30:47 +0100:
 Ben Hinkle schrieb am Wed, 08 Dec 2004 19:35:43 -0500:
 bool foo() {
   int x;
   for (;;) {
     if (x == 0)
       return true;
     x = 1;
   }
   return false;
 }

 int main() {
   foo();
   return 0;
 }

 [locks]$ dmd -g test.d
 Internal error: ../ztc/elfobj.c 1251
It's a regression between dmd-0.102 and dmd-0.104. Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.9.13 (GNU/Linux) iD8DBQFBt8gq3w+/yD4P9tIRAmeNAKChNp6LicTriS89JtAQR+Ewchqr6gCfbwTs 49uEjgXeTiSBvO2dxaBHCl4= =D3qX -----END PGP SIGNATURE-----
Dec 08 2004