[llvm-dev] Representing X86 long double in Debug Info

Keno Fischer via llvm-dev llvm-dev at lists.llvm.org
Sun Nov 1 03:14:58 PST 2015


I'm in the process of teaching the Verifier to validate that the size of
debug info variable and the described value matches (already caught a
couple of bugs, both in my frontend and in LLVM itself). However, I've run
into the following:

size of passed value (80) does not match size of declared variable (128)
  call void @llvm.dbg.declare(metadata x86_fp80* %x, metadata !11, metadata
!13), !dbg !14
  %x = alloca x86_fp80, align 16
!11 = !DILocalVariable(name: "x", scope: !4, file: !1, line: 2, type: !12)
!12 = !DIBasicType(name: "long double", size: 128, align: 128, encoding:
DW_ATE_float)
!13 = !DIExpression()

which happens because llvm knows that fp80s are 80bits, while clang
declares them as 128bits in the debug info. We might have to special case
this in the verifier, but before we do that, I wanted to ask about the
following:

Reading the DWARF standard, it seems like the following would be a valid
description of an X86 80bit long double:

DW_TAG_base_type
DW_AT_name "long double"
DW_AT_byte_size  16
DW_AT_bit_size      80

As far as I can tell from looking through the source code, both LLDB and
GDB would read this just fine, it would be a more accurate description of a
long double and if we add support for it in LLVM IR, the verifier would be
able to understand what's actually going on. Does this seem like a
reasonable thing to have LLVM do or would you prefer to just disable this
check in the verifier if there are x86_fp80 types around?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151101/04106679/attachment.html>


More information about the llvm-dev mailing list