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

ID Number: Q73191

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 with default

optimization or if the /Ot or /Os optimization is used without also

using /Oe, /Og, or /Ol:

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

(compiler file '@(#)regMD.c:1.100', line 1997)

Contact Microsoft Product Support Services

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

problem was corrected in C version 6.0a.

More Information:

The following workarounds may be used to eliminate the above error in

C version 6.0:

1. Compile with /Od (optimizations disabled) or add /Oe, /Og, or /Ol

to the /Ot or /Os optimization switches.

-or-

2. Use the optimize pragma to disable or enable optimizations for the

function in which the error occurs. The "#pragma optimize"

directive is documented on page 7 of the "Microsoft C Advanced

Programming Techniques" manual that ships with C versions 6.0, 6.0a,

and 6.0ax.

-or-

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

- or -

4. In the sample code below, change "index" to an "int" type, instead

of a "register int" type variable.

-or-

5. In the sample code below, assign the "buffer[index]" expression to

a temporary variable, and use the temporary variable to index into

the table[] array.

Sample Code

-----------

/* Compile options needed: none

*/

typedef struct

{

unsigned char red;

unsigned char green;

unsigned char blue;

} color;

static void func (color * buffer, color table[])

{

register int index;

for (index= 100; index>= 0; index--)

{

buffer[index]= table[((unsigned char *)buffer)[index]];

}

}