www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2941] New: asm fstsw AX; generates incorrect opcode

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2941

           Summary: asm fstsw AX;  generates incorrect opcode
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: clugdbug yahoo.com.au


fstsw AX;
should be producing fwait; fnstsw AX;  (9B DF E0).

Instead, it simply produces fnstsw AX; (DF E0).


-- 
May 05 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2941


clugdbug yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major




------- Comment #1 from clugdbug yahoo.com.au  2009-05-06 02:23 -------
I've found the cause: iasm.c, line 1650-1651 is:
        else if ((ptb.pptb0->usFlags & _fwait) &&
            config.target_cpu >= TARGET_80386) {

Turns out that at this point, config.target_cpu is uninitialized! It's 0!
It doesn't get initialized until much later. (In obj_start() in glue.c).
I suspect that there should be a call to out_config_init() (in msc.c) at a very
much earlier point, possibly even in mars.c.

As this could be causing all sorts of problems elsewhere, I'm raising the
severity.


-- 
May 06 2009