[LLVMbugs] [Bug 23227] New: MCExpr evaluation shouldn't always be signed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 14 10:34:19 PDT 2015


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

            Bug ID: 23227
           Summary: MCExpr evaluation shouldn't always be signed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: ahmed.bougacha at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider:

echo 'movz x1, ((0xfffffffffffffffc & 0xffff000000000000) >> 48), LSL #48' |
llvm-mc -arch aarch64

<stdin>:1:10: error: immediate must be an integer in range [0, 65535].
movz x1, ((0xfffffffffffffffc & 0xffff000000000000) >> 48), LSL #48

That's not true with a logical shift, but MCExpr evaluation works on int64_t,
and propagates the "sign" bit.

There's a FIXME for this, but, to my knowledge, no PR:
    // FIXME: We need target hooks for the evaluation. It may be limited in
    // width, and gas defines the result of comparisons and right shifts
    // differently from Apple as.

-- 
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/20150414/e0f4c78e/attachment.html>


More information about the llvm-bugs mailing list