www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7806] New: internal error when compiling with optimizations enabled

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7806

           Summary: internal error when compiling with optimizations
                    enabled
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: slayerbeast gmail.com



---
Created an attachment (id=1083)
code that produces the bug

The program attached compiles and works normally, unless compiled with
optimizations enabled:

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

---

compiler: DMD64 D Compiler v2.058
OS: gentoo linux x86_64

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 31 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7806


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



On Windows 32 bit, with DMD 2.059head it doesn't crash, but it outputs:

Without -O:
-2 -2
-1.9375 -2
-1.875 -2
-1.8125 -2
-1.75 -2
...
1.75 2
1.8125 2
1.875 2
1.9375 2
2 2


With -O:
-0 -9.88131e-324
-0 -9.88131e-324
-0 -9.88131e-324
-0 -9.88131e-324
-0 -9.88131e-324
-0 -9.88131e-324
-0 -9.88131e-324
...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7806


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice
                 CC|                            |clugdbug yahoo.com.au
            Summary|internal error when         |ICE(gloop.c) iterating with
                   |compiling with              |idouble, when compiling
                   |optimizations enabled       |with -O



Code in the attachement
----
import std.stdio;

void main()
{
    for (idouble i = -2i; i <= 2i; i += .125i)
        for (double r = -2; r <= 2; r += .0625)
        {
            cdouble c = r + i;
            writeln(c);
        }
}
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7806


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



12:40:44 PDT ---
A simpler version without all the templates:

import core.stdc.stdio;

void main()
{
    for (idouble i = -2i; i <= 2i; i += .125i)
        for (double r = -2; r <= 2; r += .0625)
        {
            cdouble c = r + i;
            printf("%g %gi\n", c.re, c.im);
        }
}

Which does not produce an internal error with -O, but does go into an infinite
loop when the compiled program is executed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 04 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7806




13:22:43 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2627

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 04 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7806




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ad9a300d9257105a1b8cab1443c2273d442ea04a
fix Issue 7806 - ICE(gloop.c) iterating with idouble, when compiling with -O

https://github.com/D-Programming-Language/dmd/commit/3e2986e09d14a90b8c0e20b15f92b586886b80d0


fix Issue 7806 - ICE(gloop.c) iterating with idouble, when compiling wit...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 05 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7806




Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/be315758f5342ad3fc3172c6f087e01cfe50ef07


fix Issue 7806 - ICE(gloop.c) iterating with idouble, when compiling wit...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 05 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7806


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 05 2013