<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Incorrectly complains about `asm volatile("rep outsw %%es:(%%esi), (%%dx)" …`"
   href="http://llvm.org/bugs/show_bug.cgi?id=15455">15455</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrectly complains about `asm volatile("rep outsw %%es:(%%esi), (%%dx)" …`
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>paulepanter@users.sourceforge.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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] <a href="http://seabios.org/Download">http://seabios.org/Download</a>
[2] <a href="http://www.seabios.org/pipermail/seabios/2013-March/005769.html">http://www.seabios.org/pipermail/seabios/2013-March/005769.html</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>