← Back to index
|
Original Bugzilla link
Bug 17386 – Internal error: backend\cgcod.c 1841
Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2017-05-09T14:37:06Z
Last change time
2020-03-21T03:56:34Z
Keywords
ice
Assigned to
No Owner
Creator
Seiji Fujita
Comments
Comment #0
by BugReport.SeijiFujita — 2017-05-09T14:37:06Z
/* Title: Internal error: backend\cgcod.c 1841 dmd version: dmd.2.074.0 dmd option: dmd -c -m64 -O -release Internal error conditions ------------------------- 1. dmd.2.073.0 - dmd.2.074.0 only 2. dmd option is "m64 - O - release" 3. asm.dlang.org confirmed that internal error occurred in "dmd nightly build, - m64 - O - release" 4. The following code is minimized by Dustmite */ int[] bezier() { int[] polygon ; for (int i ; ; i++) { double t = i ; polygon[2 * i] = cast(int)(t * t ); } } /* Original code: location: dwt org.eclipse.swt.win32.win32.x86\src\org\eclipse\swt\custom\CBanner.d(161): int[] bezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int count) { int[] bezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3, int count) { // The parametric equations for a Bezier curve for x[t] and y[t] where 0 <= t <=1 are: // x[t] = x0 + 3 (x1 - x0) t + 3 (x0 + x2 - 2x1) t ^ 2 + (x3 - x0 + 3x1 - 3x2) t ^ 3 // y[t] = y0 + 3 (y1 - y0) t + 3 (y0 + y2 - 2y1) t ^ 2 + (y3 - y0 + 3y1 - 3y2) t ^ 3 double a0 = x0; double a1 = 3 * (x1 - x0); double a2 = 3 * (x0 + x2 - 2 * x1); double a3 = x3 - x0 + 3 * x1 - 3 * x2; double b0 = y0; double b1 = 3 * (y1 - y0); double b2 = 3 * (y0 + y2 - 2 * y1); double b3 = y3 - y0 + 3 * y1 - 3 * y2; int[] polygon = new int[2 * count + 2]; for (int i = 0; i <= count; i++) { double t = cast(double) i / cast(double) count; polygon[2 * i] = cast(int)(a0 + a1 * t + a2 * t * t + a3 * t * t * t); polygon[2 * i + 1] = cast(int)(b0 + b1 * t + b2 * t * t + b3 * t * t * t); } return polygon; } /// Dustmite // dmd -c -m64 -O -release CBanner_dmdInternalerror.d > out.txt // dustmite src "dmd -c -m64 -O -release CBanner_dmdInternalerror.d | diff - ..\out.txt" */
Comment #1
by b2.temp — 2019-05-30T20:06:54Z
fixed since 2.076.1 :
https://run.dlang.io/is/Hsph09
now i'm quite surprised to see that because of the infinite loop no ReturnStatement is required.