https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81504
--- Comment #1 from Zoltan Hidvegi <zoltan at hidvegi dot com> --- This may not be a gcc-7 regression, my application fails even with gcc-6, even with -O1 when I use vec_ld and vec_st, but works if I replace them with vec_xl and vec_xst, and also works when I replace it with inline assembly generating lvx / stvx. This particular example works with gcc-6 or gcc-7 -O1, probably gcc-7 -O2 creates the right condition for the misoptimization to happen. I will try to distill down a simple example that shows the bug with gcc-6 but it'll take a wile. But maybe this example will be enough to show the root cause for someone who knows where to look.