C9110005: C1001: exphelp.c, Line 698

ID Number: Q77946

6.00 6.00a 6.00ax | 6.00 6.00a

MS-DOS | OS/2

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

Summary:

PROBLEM ID: C9110005

SYMPTOMS

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

following internal compiler error messages when the sample code

below is compiled under large (/AL) or compact (/AC) memory model

and using any optimization that does not contain /Oe, /Og, or /Ol.

Under C 6.0a and C6.0ax:

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

(compiler file '@(#)exphelp.c:1.117', line 698)

Contact Microsoft Product Support Services

Under C 6.0:

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

(compiler file '@(#)exphelp.c:1.115', line 698)

Contact Microsoft Product Support Services

RESOLUTION

The following are four possible workarounds for this error:

1. Use any optimization that contains /Ol (loop optimization), /Oe

(enable global register allocation), or /Og (enable global

optimizations and global common expressions). In the sample code

below, this is the best workaround.

2. Simplify the code by using temporary variables.

3. Use any memory model other than /AL or /AC.

4. Compile using the /qc (Quick Compile) option.

STATUS

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.

More Information:

Sample Code

-----------

/* Compiler options needed: /AL /c

*/

typedef struct

{

char array[2];

} struct_type;

void function(void);

void function(void)

{

struct_type *struct_ptr;

unsigned long ul;

ul = (unsigned long)struct_ptr >>16;

ul += *((unsigned *)((struct_ptr)->array)) + 1;

struct_ptr = (struct_type *)(ul << 16);

} /* Error occurs here */

/* End of sample */

Additional reference words: 6.00 6.00a 6.00ax