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: unassignedb...@nondot.org
          Reporter: llvm-bugzi...@jbeekman.nl
                CC: htmldevelo...@gmail.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to