[llvm-bugs] [Bug 33848] New: X86 Asm does not support symbolic names inside address calculation

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 19 05:21:46 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33848

            Bug ID: 33848
           Summary: X86 Asm does not support symbolic names inside address
                    calculation
           Product: tools
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-as
          Assignee: unassignedbugs at nondot.org
          Reporter: andrew.v.tischenko at gmail.com
                CC: llvm-bugs at lists.llvm.org

When we deal with complex address expression like 

  [foo + scale * RAX + RDX]

the current implementation does not support at least the following:

1. The negative number as symbolic name: see PR3367
   .set one 1
   lea rdx, [rax - one]
2. The scale as symbolic name
   .set scale, 4
   12345 + scale * RAX + RDX
3. Two different symbolic names in one expression
   foo + scale * RAX + RDX
4. It crashes when bogus scale value is used: see PR33661
   lea  rdx, [rax + -1*rcx]
5. In addition it depends on arguments order
6.1. And there is some "pseudo" interpreter to calculate the primitive
expressions like +, -, *, /, etc. This interpreter has assertion to use
immediates for all ops except plus and minus. As result in ops like [rax - one]
it assumes that rax has value 0 in all cases but why? It seems it's wrong.
6.2. And the second about the same: the assertions should be replaced with
error messages because currently we simply see the compiler crash instead of
any diagnostic.

-- 
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/20170719/644380c5/attachment.html>


More information about the llvm-bugs mailing list