[llvm-bugs] [Bug 43975] New: Incorrect call site values for parameters produced by MOVZXi on AArch64

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 12 04:11:08 PST 2019


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

            Bug ID: 43975
           Summary: Incorrect call site values for parameters produced by
                    MOVZXi on AArch64
           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

Reproduced on 636412bf31fc4285d63faeea67e4d71e44e3799c.

Compiling the following code:

    #include <stdint.h>

    extern void call1(int64_t);
    extern void call2(int64_t);
    extern void call3(int64_t);
    extern void call4(int64_t);

    void caller() {
      call1(UINT64_C(1) << 0);
      call2(UINT64_C(1) << 16);
      call3(UINT64_C(1) << 32);
      call4(UINT64_C(1) << 48);
    }

using the following command:

    clang movz.c --target=aarch64 -O1 -g -Xclang -femit-debug-entry-values -c

gives the following call site entries for the calls to call[1-4]:

    $ llvm-dwarfdump movz.o | grep -E '(abstract_origin|call_site_value)'
                  DW_AT_abstract_origin (0x0000002a "call1")
                    DW_AT_GNU_call_site_value   (DW_OP_lit1)
                  DW_AT_abstract_origin (0x0000003e "call2")
                    DW_AT_GNU_call_site_value   (DW_OP_constu 0x10000)
                  DW_AT_abstract_origin (0x0000004b "call3")
                    DW_AT_GNU_call_site_value   (DW_OP_lit1)
                  DW_AT_abstract_origin (0x00000058 "call4")
                    DW_AT_GNU_call_site_value   (DW_OP_constu 0x10000)

As seen, the values passed to call3 and call4 are incorrect; 1 instead of
0x100000000 and 0x10000 instead of 0x1000000000000.

The issue seems to be that in AArch64InstrInfo::describeLoadedValue() a 32-bit
shift is used when calculating the immediate:

    5762     int Immediate = MI.getOperand(1).getImm();
    5763     int Shift = MI.getOperand(2).getImm();
    5764     return ParamLoadedValue(MachineOperand::CreateImm(Immediate <<
Shift),
    5765                             nullptr);

-- 
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/20191112/a231e1e9/attachment.html>


More information about the llvm-bugs mailing list