C1001: Internal Compiler Error: code.c, Line 393

ID Number: Q28001

5.00 5.10

MS-DOS

buglist5.00 buglist5.10 fixlist6.00

Summary:

The C version 5.00 and 5.10 compilers produce the following internal

compiler error when the sample program below is compiled with /AL and

/Ol:

fatal error C1001: Internal Compiler Error

(compiler file '@(#)code.c:1.43', line 393)

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

5.10. This problem was corrected in C version 6.00.

More Information:

The above error can be worked around for the program below by

declaring a temporary variable and assigning it to KPSLPIND(event).

You can then use the temporary variable as the index for the array

Sleepqs.

Sample Code

-----------

/* Program to show internal compiler error */

/* Command line: cl /c /AL /Ox */

typedef struct proc

{

struct proc *prnext;

struct proc *prprev;

long prstatus;

long prkpid;

char *prpdata;

char **prpaddr;

long prpri;

long prsubpri;

char *prevent;

long prcpu;

long prnotrun;

long prsignal;

char *prstack;

long (*prpc)();

long prarg;

long prregsave[REGSIZE];

long prsp;

long prvaxpc;

} PROC;

typedef struct procq

{

struct proc *prfirst;

struct proc *prlast;

} PROCQ;

#define SLPHASH 256

extern PROCQ Sleepqs[SLPHASH];

#define KPSLPIND(event) (((long)(event) >> 4) & 0xFF)

int kpaddprocq( PROCQ *, PROC *);

void upsleep( char *);

void upsleep(event)

char *event;

{

register PROC *procp;

( void) kpaddprocq(&Sleepqs[KPSLPIND(event)], procp);

}