<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 3, 2017 at 9:19 AM Tim Northover via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2017-08-03 8:58 GMT-07:00 Johan Engelen via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>:<br>
> The error is gone after removing (or reducing) the alignment of `%a`. This<br>
> makes me believe that our inline asm syntax is correct to add an offset to a<br>
> pointer: " 4+$0 ".<br>
<br>
The AT&T syntax for a displaced address doesn't have the '+'; it's<br>
just "4(%rsp)" so you should change the IR to "4$0".<br>
<br>
LLVM appears to be optimizing the addressing mode, and the optimizer<br>
is being more lenient on this detail so you're getting lucky when the<br>
+4 can be combined with an existing %rsp offset.<br><br></blockquote><div><br></div><div>FWIW we do support:</div><div><br></div><div>4+4(%rsp)</div><div><br></div><div>as 8(%rsp)</div><div><br></div><div>we just don't support</div><div><br></div><div>4+(%rsp)</div><div><br></div><div>but do support</div><div><br></div><div>4+0(%rsp)</div><div><br></div><div>as 4(%rsp)</div><div><br></div><div>oddly enough gas does support the 4+(%rsp) but I've never had time to go try to fix it in the assembler.</div><div><br></div><div>-ericĀ </div></div></div>