I'm not sure if this solves PR46839 completely, but reducing the casting should help:
https://bugs.llvm.org/show_bug.cgi?id=46839
I have not dealt much with pointer casts, so if anyone sees any corner-cases to test/avoid, please comment. Alive2 does not appear to support these ops.