C1001: Internal Compiler Error: regMD.c, Line 3837

ID Number: Q61620

6.00 | 6.00

MS-DOS | OS/2

buglist6.00 fixlist6.00a

Summary:

The Microsoft C Compiler version 6.0 produces the following internal

compiler error when the sample program below is compiled for large

(/AL) or compact (/AC) memory model with /Oi (use intrinsics) and /Oe

(global register allocation) optimizations:

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

(compiler file '@(#)regMD.c:1.00', line 3837)

Contact Microsoft Product Support Services

More Information:

Placing the #pragma function(memcpy) in the code causes the compiler

to generate a function call to memcpy rather than to make it

intrinsic. Using the optimize pragma turns off the offending

optimization for that section of code. Since both /Oi and /Oe are

needed to cause the error, either pragma will work around the problem.

Microsoft has confirmed this to be a problem in C version 6.0. This

problem was corrected in C version 6.0a.

Sample Code

-----------

/* Compile options needed: /Oie

*/

unsigned x[4];

int *y;

int z;

void f1(void)

{

}

// #pragma function(memcpy) This is one workaround.

// #pragma optimize("e", off) This is another.

// #pragma optimize("i", off) This is a third.

void f2(void)

{

int i;

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

if(i<x[1])

memcpy(&z,&(y[i]),2);

}

// #pragma intrinsic(memcpy) Turn intrinsics back on.

// #pragma optimize("e", on) Turn global register allocation back on.

// #pragma optimize("i", on) Turn intrinsics back on.

Additional reference words: 6.00 6.00a