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

ID Number: Q65245

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 /Oe and /Oi optimization:

file.c(45) : fatal error c1001 Internal Compiler Error

(compiler file '@(#)regMD.c:1:100', line 4634)

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

problem was corrected in C version 6.0a.

The following are two workarounds in C version 6.0:

1. Avoid using both the /Oe and /Oi optimizations together.

-or-

2. Assign both structure references in line 45 to temp variables and

replace them with their respective temp variables.

Sample Code

-----------

/* Compile options needed: /AL /Oei

*/

#include <string.h>

#include <stdlib.h>

void change_value (int *n);

typedef struct smpdata_st *SMP;

typedef struct fdata_st *FDP;

struct fdata_st

{

int resolution,

nwaves,

startwv,

endwv;

char fname[13];

SMP data;

};

struct smpdata_st

{

float *abs;

SMP next;

};

void main(void)

{

extern FDP fptr;

FDP fp = fptr;

SMP p;

int count;

int nsamples, nwaves, startwv = 0;

int temp1, temp2;

char fname[13];

change_value(&nsamples);

change_value(&nwaves);

strcpy (fp -> fname, fname);

if (startwv < fp -> startwv)

{

count = (fp->startwv - startwv) / fp->resolution;

p = fp -> data;

while (p != NULL)

{

memmove (p -> abs + count, p -> abs,

fp -> nwaves * sizeof *p -> abs);

p = p -> next;

}

}

}

Additional reference words: 6.00 6.00a