[Bug tree-optimization/81740] [6/7/8 Regression] wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 12 13:21:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81740
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Eventually PR60276 is related for which I introduced STMT_VINFO_MIN_NEG_DIST
which is checked just by vectorizable_load (vectorizable_store didn't support
negative distances at the time). One part says
/* Invalidate assumptions made by dependence analysis when vectorization
on the unrolled body effectively re-orders stmts. */
if (ncopies > 1
...
that suggests the issue is related given for outer loop vectorization we
unroll the inner loop. It also suggests a testcase for the store case
with just inner loop vectorization might be possible.
I never liked this post-fact throwing away of the dependence analysis
result so a fix to dependence analysis should eventually also fix the
PR60276 issue, removing the need for STMT_VINFO_MIN_NEG_DIST.
The dependence checking loop over distance vectors just looks at the
distance for the outer loop.
More information about the Gcc-bugs
mailing list