I've had similar problems with pointer arithmetic, maybe you can try adding compiler options -fno-tree-vrp and -fno-tree-dominator-opts to avoid misoptimization.
I've had similar problems with pointer arithmetic, maybe you can try adding compiler options -fno-tree-vrp and -fno-tree- dominator- opts to avoid misoptimization.