]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end: copy STMT_VINFO_STRIDED_P when DR is replaced [PR116956]
authorTamar Christina <tamar.christina@arm.com>
Mon, 14 Oct 2024 13:01:24 +0000 (14:01 +0100)
committerTamar Christina <tamar.christina@arm.com>
Mon, 14 Oct 2024 13:01:24 +0000 (14:01 +0100)
commitec3d3ea60a55f25a743a037adda7d10d03ca73b2
tree62c5a07fb93c6ddc855af698816d878d9db09cb9
parentbe966baa353dfcc20b76b5a5586ab2494bb0a735
middle-end: copy STMT_VINFO_STRIDED_P when DR is replaced [PR116956]

When move_dr copies a DR from one statement to another, it seems we've
forgotten to copy the STMT_VINFO_STRIDED_P flag.  This leaves the new DR in a
broken state where it has a non constant stride but isn't marked as strided.

This causes the ICE in the PR because dataref analysis fails during epilogue
vectorization because there is an assumption in place that while costing may
fail for epiloque vectorization, that DR analysis cannot if it succeeded for
the main loop.

gcc/ChangeLog:

PR tree-optimization/116956
* tree-vectorizer.cc (vec_info::move_dr): Copy STMT_VINFO_STRIDED_P.

gcc/testsuite/ChangeLog:

PR tree-optimization/116956
* gfortran.dg/vect/pr116956.f90: New test.
gcc/testsuite/gfortran.dg/vect/pr116956.f90 [new file with mode: 0644]
gcc/tree-vectorizer.cc