[PATCH] D37945: [X86] [ASM INTEL SYNTAX] fix for incorrect assembler code generation when x86-asm-syntax=intel (PR34617)

coby via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 12:58:09 PDT 2017


coby added a comment.

suggested change will work fine if one is to solely consider masm / gas, as llvm's (x86) integrated assembler is yet to be introduced to the 'offset' keyword (handle it partially and falsely as part of inline-asm only).
for example, the following (dumb) snippet:

  void *f() {
    return "";
  }

under **//clang -cc1 -S -mllvm -x86-asm-syntax=intel -mrelocation-model static//** will produce the following asm (amongst other boilerplate):

  movabs  rax, offset .L.str

which in turn, under **//clang -cc1as rep.s//** will yield:

  error: cannot use more than one symbol in memory operand

see https://reviews.llvm.org/D37461 for a comprehensive proposal, which answers PR34617 as well


Repository:
  rL LLVM

https://reviews.llvm.org/D37945





More information about the llvm-commits mailing list