C9011000: C1001: grammar.c, Line 140

ID Number: Q67235

6.00a 6.00ax | 6.00a

MS-DOS | OS/2

buglist6.00a buglist6.00ax

Summary:

SYMPTOMS

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

following internal compiler error when the sample program below is

compiled with default optimizations for the compact (/AC), large

(/AL), or huge (/AH) memory model:

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

(compiler file '../grammar.c', line 140)

Contact Microsoft Product Support Services

RESOLUTION

The following are valid workarounds:

1. Compile with /Od (optimizations disabled).

-or-

2. Use the optimize pragma to disable optimizations for the

function in which the error occurs. This command should resemble

the following:

#pragma optimize("",off)

-or-

3. Compile for small (/AS) or medium (/AM) memory model.

-or-

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

-or-

5. Simplify the code. In the example below, you can assign the "0 -

msc.a" expression to a temporary variable, and assign the

temporary variable to msc.a on line 15.

STATUS

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

6.0ax. We are researching this problem and will post new

information here as it becomes available.

More Information:

The following sample code compiled with default options and /AH, /AL,

or /AC will generate the error.

Sample Code

-----------

void func(void);

void sub(void);

struct _msc

{

long a;

};

extern struct _msc msc;

void sub()

{

msc.a = 0 - msc.a;

func();

msc.a = 0 - msc.a;

}