[llvm-bugs] [Bug 47740] New: LVI-CFI overwrites register used for return value

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 6 00:57:50 PDT 2020


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

            Bug ID: 47740
           Summary: LVI-CFI overwrites register used for return value
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-bugzilla at jbeekman.nl
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

The following code:

target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define { i64, i128 } @ret_i64_i128() #0 {
  ret { i64, i128 } { i64 1, i128 36893488147419103235 }
}

attributes #0 = { "target-features"="+lvi-cfi" }

Generates the following assembly:

ret_i64_i128:                           # @ret_i64_i128
        .cfi_startproc
# %bb.0:
        movl    $1, %eax
        movl    $3, %edx
        movl    $2, %ecx
        popq    %rcx
        lfence
        jmpq    *%rcx
.Lfunc_end0:
        .size   ret_i64_i128, .Lfunc_end0-ret_i64_i128
        .cfi_endproc

As you can tell, the LVI-CFI pass is using RCX although that register was used
for part of the return value.

-- 
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/20201006/9d22ea40/attachment.html>


More information about the llvm-bugs mailing list