[llvm-bugs] [Bug 28624] New: lib/Target/AArch64/AArch64InstrInfo.cpp:3556: suspicious shift ?

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 20 00:03:18 PDT 2016


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

            Bug ID: 28624
           Summary: lib/Target/AArch64/AArch64InstrInfo.cpp:3556:
                    suspicious shift ?
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dcb314 at hotmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

trunk/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:3556]: (error) Shifting
32-bit value by 32 bits is undefined behaviour

Source code is

    uint64_t UImm = -Imm << (64 - BitSize) >> (64 - BitSize);

Maybe better code

    uint64_t UImm = ((uint64_t) -Imm) << (64 - BitSize) >> (64 - BitSize);

-- 
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/20160720/3d03a9de/attachment.html>


More information about the llvm-bugs mailing list