C9011000: C1001: regMD.c, Line 1017

ID Number: Q67006

6.00 6.00a 6.00ax | 6.00 6.00a

MS-DOS | OS/2

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

Summary:

SYMPTOMS

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

following internal compiler error when the sample program below is

compiled with with /Oe (global register allocation) or /Ox

optimization:

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

(compiler file '@(#)regMD.c:1.110', line 1017)

Contact Microsoft Product Support Services

CAUSE

The error is related to the multiple structure member assignments.

The following are possible workarounds for this problem:

- Simplify statements with structure assignments as much as

possible.

- Disable global register allocation by not using /Oe.

- Use the #optimize pragma to turn global register allocation

off for the particular functions where problems occur.

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/C++ version 7.0.

More Information:

Sample Code

-----------

/* Compile options needed: /Oe

*/

#include <stdlib.h>

typedef struct {

short x0, y0, x1, y1;

} BOX;

typedef struct {

long x0, y0, x1, y1;

} LONG_RCT;

typedef LONG_RCT *LONG_RCT_PTR;

LONG_RCT_PTR compute_extent(BOX *bound)

{

static LONG_RCT rct;

rct.x0 = (long) min(bound->x0, bound->x1);

rct.y0 = (long) min(bound->y0, bound->y1);

rct.x1 = (long) max(bound->x0, bound->x1);

rct.y1 = (long) max(bound->y0, bound->y1);

return(&rct);

}