Open Quuxplusone opened 4 years ago
Sorry, typo. Meant to say: "It seems that the broken case is initially writing over x8
in ldxr x8,[x8]
and then reading from a corrupted value in that same instruction if we jump back to it from the cbnz
."
The generated code is clear violation of the "earlyclobber" constraint, i.e. the "&" in [prev]"=&r". Logic related to earlyclobber might be involved in what's broken.
I've posted https://reviews.llvm.org/D80467 for review.
Please let me know if it solves your problem.
Cobalt on Fuchsia is crashing with the following backtrace:
The issue seems to point to this inline assembly in protobuf:
A bisect seems to show commits https://reviews.llvm.org/rG91063cf85a4038537731f582a27936187fb0759c and https://reviews.llvm.org/rG5425cdc3adf9998aeaf587d93417bd2f4f1373c9 both contribute to this crash. Comparing the assembly in a working case vs a broken case:
Working (ToT those commits reverted)
Broken (ToT)
It seems that the broken case is initially writing over
x8
inldxr x8,[x8]
and then reading from a corrupted value instxr w9, x11, [x8]
. The instruction that we also seem to be crashing on is theldxr x8, [x8]
, probably because we're loading from a bad value when jumping back to it.This can be reproduced with
clang++ --target=aarch64-fuchsia -O0 /tmp/test.cc
. Note that can only reproduce this on AArch64 at -O0 since this should be the only configuration that uses GlobalISel.