[clang] [openmp] [llvm] [clang-tools-extra] Fix Issue #76121 [OpenMP] [Flang] Program crashes at runtime (PR #76122)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 2 01:16:37 PST 2024
shivaramaarao wrote:
These cmov instructions load the operand irrespective of condition satisfaction.
=> cmpq $4, %rax
=> cmovnsq 24(%r11), %r9
here r11 is 0 and 24(0) will be loaded even if argc < 4 and hence we get this crash. if we pass the address of argv, we will get a valid address to load.
I think we need to add a check for argc <=0 in this function. But, there may be performance implications with this extra check.
https://github.com/llvm/llvm-project/pull/76122
More information about the llvm-commits
mailing list