[Bug tree-optimization/108008] [12 Regression] wrong code with -O3 and posix_memalign

amonakov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 8 08:44:48 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108008

--- Comment #9 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
I think this is tree-ldist placing memset(sameZ, 0, zPlaneCount) after the
loop, overwriting conditional 'sameZ[i] = true' assignments that happen in the
loop.

For the smaller testcase from comment #6, -O2 -ftree-loop-distribution is
enough, namely:

works:

gcc-12 -O2 -ftree-loop-distribution -fno-tree-vectorize
-fno-tree-loop-distribute-patterns

breaks:

gcc-12 -O2 -ftree-loop-distribution -fno-tree-vectorize


More information about the Gcc-bugs mailing list