Debugging AoT compile errors

Through further testing, it looks like this is a regression introduced by one or another optimization in Julia 1.1. With 1.0.3 and -O3 it works, and with 1.1 and -O1 it works, but with 1.1 and -O2 or -O3 it fails as seen above.