[llvm-bugs] [Bug 39618] New: clang-cl encodes signed arbitrary precision integers incorrectly.

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 10 10:42:31 PST 2018


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

            Bug ID: 39618
           Summary: clang-cl encodes signed arbitrary precision integers
                    incorrectly.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: zturner at google.com
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org,
                    mosescu at google.com, rnk at google.com

enum SmallSignedEnum : char {
    SSE_A = 0,
    SSE_B = 100,
    SSE_C = -100,
  };


SmallSignedEnum GlobalEnumA = SSE_A;
SmallSignedEnum GlobalEnumB = SSE_B;
SmallSignedEnum GlobalEnumC = SSE_C;

int main(int argc, char **argv) {
  return GlobalEnumA + GlobalEnumB + GlobalEnumC;
}

Compile with clang-cl and MSVC, and compare the results of dumping the
LF_ENUMERATE field list members.  For SSE_C, with clang-cl llvm-pdbutil outputs
this:

- LF_ENUMERATE [SSE_C = 18446744073709551516]

Whereas with cl, llvm-pdbutil outputs this:

- LF_ENUMERATE [SSE_C = -100]

I suspect that clang's version is equivalent to -100 mod 2^64, but we should
really be emitting the exact same byte sequence as cl, and we clearly aren't.

-- 
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/20181110/f5bc13b3/attachment-0001.html>


More information about the llvm-bugs mailing list