<div class="gmail_quote">On Mon, Aug 17, 2009 at 4:16 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">On Mon, Aug 17, 2009 at 12:25 PM, Zhi Wang<<a href="mailto:beiyuw@gmail.com">beiyuw@gmail.com</a>> wrote:<br>
> BTW, it seems clang can't handle the "=rm" inline assembly code as in the<br>
> following:<br>
> static inline struct pcpu_gs *percpu ()<br>
> {<br>
>         struct pcpu_gs         *gs;<br>
><br>
>         asm volatile ("movq %%gs:gs_self, %0" : "=rm" (gs));<br>
>         return gs;<br>
> }<br>
><br>
> clang will generate code like:<br>
><br>
> movq %gs:gs_self, -8(%rbp)<br>
><br>
> leading gas to complain: Error: too many memory references for `movq'<br>
<br>
</div>The code is wrong... the constraint should be "=r", not "=rm".<br>
<font color="#888888"><br>
-Eli<br>
</font></blockquote></div>Indeed, thanks again.<br><br>--Zhi<br>