problem compiling with optimizations enabled

darkstalker slayerbeast at gmail.com
Sat Mar 31 16:35:39 PDT 2012


I have the following source:

---
import std.stdio;

string ascii = " .:;+=xX$&";

void main()
{
     for (idouble i = -2i; i <= 2i; i += .125i)
     {
         for (double r = -2; r <= 2; r += .0625)
         {
             auto c = r + i;
             auto z = 0 + 0i;
             int iter;
             do
             {
                 z = z * z + c;
                 if (z.re * z.re + z.im * z.im > 4)
                     break;
                 ++iter;
             } while (iter < ascii.length - 1);
             write(ascii[iter]);
         }
         writeln();
     }
}
---

It compiles and works normally, unless i turn in optimizations:

---
$ dmd -O program.d
Internal error: backend/gloop.c 3400
---

Is this a bug? or something wrong in my code?

compiler: DMD64 D Compiler v2.058 (64 bit)
OS: gentoo linux x86_64



More information about the Digitalmars-d mailing list