C 6.0 May Incorrectly Generate FLD for FILD in Inline Assembly

ID Number: Q68907

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 may

incorrectly generate an "fld" instruction instead of an "fild" when

using inline assembly.

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:

The sample code below illustrates this problem. Compiling the code

with /Fa (to produce an assembly listing) shows the following

statement to correspond with the inline assembly statement in the

sample code:

fld QWORD PTR [bp+4]

The correct instruction should be:

fild QWORD PTR [bp+4]

When the /qc (quick compile) option is specified, the correct code is

generated.

Sample Code

-----------

/* Compile options needed: /Fa

*/

typedef struct qw_tag {

unsigned char b[10];

} qw;

void _cdecl func1( qw a );

void main( )

{

qw a;

func1( a );

}

void _cdecl func1( qw a )

{

_asm fild qword ptr a

}