www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Issue 2053] New: PIC & ASM (EBX clobbering)

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

           Summary: PIC & ASM (EBX clobbering)
           Product: DGCC aka GDC
           Version: unspecified
          Platform: Macintosh
        OS/Version: Mac OS X
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: glue layer
        AssignedTo: dvdfrdmn users.sf.net
        ReportedBy: fawzi gmx.ch


I am no ams and PIC expert, but I think that the following code
{{{
                    volatile asm
                    {
                        push EDI;
                        lea EDI, newval;
                        mov ESI, [EDI];
                        mov ECX, 4[EDI];
                        lea EDI, equalTo;
                        mov EAX, [EDI];
                        mov EDX, 4[EDI];
                        mov EDI, val;
                        push EBX;
                        xchg EBX, ESI;
                        lock; // lock always needed to make this op atomic
                        cmpxch8b [EDI];
                        setz AL;
                        mov EBX, ESI;
                        pop EBX;
                        pop EDI;
                    }
}}}
should work on x86 when compiled with -fPIC, because EBX is pushed & popped and
no variable or symbol is accessed between push & pop.

The compiler complains about clobbered EBX (from the two xchg EBX and mov EBX
expressions).


-- 
Apr 28 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2053


sean invisibleduck.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED





Oh I see what you're saying.  Thanks.  I'll make this change.


-- 
Apr 28 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2053


Iain Buclaw <ibuclaw ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |INVALID



D Inline Assembler support in GDC has been yanked out. So this report is no
longer valid.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 06 2012