C1001: Internal Compiler Error: newcode.c, Line 551

ID Number Q70075

6.00 6.00a 6.00ax | 6.00 6.00a

MS-DOS | OS/2

buglist6.00 buglist6.00a buglist6.00ax fixlist7.00

Summary:

The Microsoft C Compiler versions 6.0, 6.0a, and 6.0ax produce the

following internal compiler error when the sample program below is

compiled with /Ox or /Oel:

file.c(26) : fatal error C1001: Internal Compiler Error

(compiler file '@(#)newcode.c:1.87', line 551)

Contact Microsoft Product Support Services

Microsoft has confirmed this to be a problem in C versions 6.0, 6.0a,

and 6.0ax. This problem was corrected in C version 7.0.

Valid ways to work around this problem include:

1. Compile with optimization that does not include both loop

optimization (/Ol) and global register allocation (/Oe).

-or-

2. Use the optimize pragma to disable global register allocation ("e")

or the loop_opt pragma to disable loop optimization.

-or-

3. Compile with the /qc (quick compile) option.

An example of the second work around is shown in the sample code

below. Uncomment the lines with #pragma directives to eliminate the

error. The advantage to the second solution is that the "e"

optimization will be used for the other function in the source file.

Sample Code

-----------

/* Compile options needed: /Ox

*/

typedef struct

{

int x;

int y;

} POINT;

typedef struct

{

float x,y;

} FPOINT;

//#pragma optimize("e", off)

static void Badfunc(POINT *pptA, POINT pptPolyB[],

POINT pptPolyA[], int nSides)

{

FPOINT fptA;

FPOINT PolyB[4];

FPOINT PolyA[4];

int i;

fptA.x = pptA->x;

fptA.y = pptA->y;

for (i = 0; i < nSides; i++)

{

PolyA[i].x = (float)pptPolyA[i].x;

PolyA[i].y = (float)pptPolyA[i].y;

PolyB[i].x = (float)pptPolyB[i].x;

PolyB[i].y = (float)pptPolyB[i].y;

}

return;

}

//#pragma optimize("e", on)