[llvm-bugs] [Bug 33667] New: lea rdx, [rax - one] adds one instead of subtracts when one is a symbol that has been .set

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 30 20:49:00 PDT 2017


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

            Bug ID: 33667
           Summary: lea rdx, [rax - one] adds one instead of subtracts
                    when one is a symbol that has been .set
           Product: new-bugs
           Version: 4.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mike.benfield at gmail.com
                CC: llvm-bugs at lists.llvm.org

In the following example, I would expect both registers rsi and rdx to contain
0, but that is not the case.

$ cat trash.s
.intel_syntax noprefix

.set    one, 1

.text
        .global _main
_main:
        mov     rax, 1
        lea     rsi, [rax - 1]
        lea     rdx, [rax - one]
        lea     rdi, [rip + fstring]
        sub     rsp, 8
        call    _printf
        add     rsp, 8
        ret

.data
fstring:
.asciz  "%d, %d\n"
$ clang trash.s
$ ./a.out
0, 2

-- 
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/20170701/9fb9f178/attachment.html>


More information about the llvm-bugs mailing list