[llvm-bugs] [Bug 43525] New: 64-bit call site value immediate is	truncated
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Tue Oct  1 07:29:58 PDT 2019
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=43525
            Bug ID: 43525
           Summary: 64-bit call site value immediate is truncated
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: david.stenberg at ericsson.com
                CC: jdevlieghere at apple.com, keith.walker at arm.com,
                    llvm-bugs at lists.llvm.org,
                    paul_robinson at playstation.sony.com
When compiling the following test program:
  #include <stdint.h>
  extern void foo(uint64_t);
  int main() {
    foo(UINT64_C(0x1122334455667788));
    return 0;
  }
using:
  clang -O1 -g -Xclang -femit-debug-entry-values -c call.c
the call site value for the 64-bit parameter is truncated to 32 bits:
  0x00000064:       DW_TAG_GNU_call_site_parameter
                      DW_AT_location    (DW_OP_reg5 RDI)
                      DW_AT_GNU_call_site_value (DW_OP_constu 0x55667788)
The truncation happens in collectCallSiteParameters():
  if (auto ParamValue = TII->describeLoadedValue(*I)) {
    if (ParamValue->first->isImm()) {
      unsigned Val = ParamValue->first->getImm(); <---------------
      DbgValueLoc DbgLocVal(ParamValue->second, Val);
      finishCallSiteParam(DbgLocVal, Reg);
  [...]
DbgValueLoc takes a int64_t immediate, so if I change Val to a int64_t, the
correct value is emitted:
  0x00000064:       DW_TAG_GNU_call_site_parameter
                      DW_AT_location    (DW_OP_reg5 RDI)
                      DW_AT_GNU_call_site_value (DW_OP_constu
0x1122334455667788)
-- 
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/20191001/c94fc76f/attachment.html>
    
    
More information about the llvm-bugs
mailing list