[LLVMbugs] [Bug 15455] New: Incorrectly complains about `asm volatile("rep outsw %%es:(%%esi), (%%dx)" …`

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 6 03:25:23 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15455

            Bug ID: 15455
           Summary: Incorrectly complains about `asm volatile("rep outsw
                    %%es:(%%esi), (%%dx)" …`
           Product: clang
           Version: 3.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: paulepanter at users.sourceforge.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Using Debian Sid/unstable and Clang 3.2 from Debian experimental

        $ clang --version
        Debian clang version 3.2-1~exp6 (tags/RELEASE_32/final) (based on LLVM
3.2)
        Target: i386-pc-linux-gnu
        Thread model: posix

to build SeaBIOS [1], Clang throws the following errors.

        $ git clone git://git.seabios.org/seabios.git seabios
        $ git show
        commit f465e1ec1b01826100c92b890487a2ab09bfe2c1
        Author: Kevin O'Connor <kevin at koconnor.net>
        Date:   Sat Feb 23 21:33:36 2013 -0500

            Minor - introduce numeric defines for the IVT offset of hw irqs.
        $ make menuconfig # coreboot chosen, see attached
        $ CC=clang make
        […]
        In file included from src/ata.c:9:
        src/ioport.h:126:18: error: invalid operand for instruction
            asm volatile("rep outsw %%es:(%%esi), (%%dx)"
                         ^
        <inline asm>:1:12: note: instantiated into assembly here
                rep outsw %es:(%esi), (%dx)
                          ^~~~~~~~~~
        In file included from src/ata.c:9:
        src/ioport.h:113:18: error: invalid operand for instruction
            asm volatile("rep insw (%%dx), %%es:(%%edi)"
                         ^
        <inline asm>:1:11: note: instantiated into assembly here
                rep insw (%dx), %es:(%edi)
                         ^~~~~
        2 errors generated.
        make: *** [out/ata.o] Fehler 1

The lead developer Kevin O’Connor claims the code is correct.

    static inline void outsw(u16 port, u16 *data, u32 count) {
        asm volatile("rep outsw %%es:(%%esi), (%%dx)"
                     : "+c"(count), "+S"(data) : "d"(port) : "memory");
    }

[1] http://seabios.org/Download
[2] http://www.seabios.org/pipermail/seabios/2013-March/005769.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130306/06561b44/attachment.html>


More information about the llvm-bugs mailing list