Issue 164221
Summary Confusing register usage encountered during V8 Arm64EC porting.
Labels new issue
Assignees
Reporter scout-zeng
    We are working on Arm64EC porting with the clang version as follows:
clang version 21.0.0git (https://chromium.googlesource.com/a/external/github.com/llvm/llvm-project 09006611151c7f85862a9da8da34872c456c2c37).
Through some patches on V8 project, we successfully compiled the ARM64EC version of V8. However, when we tested a simple _javascript_ script using the command `d8.exe -e "console.log('hi')"`,  we encountered a crash.

The assembly code where the exception occurred is as follows:
`v8!v8::debug::ConsoleDelegate::`vcall'{24}'+0x8:
00007ffd`f55a5db8 a93e8881 stp         x1,x2,[x4,#-0x18]
00007ffd`f55a5dbc f000b46a adrp x10,v8!_x64_code_ranges_to_entry_points+0x2e211 (00007ffd`f6c34000)
00007ffd`f55a5dc0 f81f8083 stur x3,[x4,#-8]
00007ffd`f55a5dc4 f9400009 ldr x9,[x0]
00007ffd`f55a5dc8 f9400d2b ldr x11,[x9,#0x18]
00007ffd`f55a5dcc f943c949 ldr x9,[x10,#0x790]
00007ffd`f55a5dd0 d000a16a adrp x10,v8!_impchk_strlen+0x8 (00007ffd`f69d3000)
00007ffd`f55a5dd4 911dc14a add x10,x10,#0x770
`
We are confused about the x4 register usage, the value of x4 register is 000000000000000c. Obviously, we cannot access memory with x4-0x18, and then, there is an exception throw out. The usage of x4 register is quite strange. Based on the stack information we examined, we didn't find any writes to the x4 register, yet it is clearly being used here. I have no other way to continue investigating this issue, so i hope the LLVM community can provide some insights from the compiler's perspective.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to