middle-end: check memory accesses in the destination block [PR113588].
When analyzing loads for early break it was always the intention that for the exit where things get moved to we only check the loads that can be reached from the condition. However the main loop checks all loads and we skip the destination BB. As such we never actually check the loads reachable from the COND in the last BB unless this BB was also the exit chosen by the vectorizer. This leads us to incorrectly vectorize the loop in the PR and in doing so access out of bounds. gcc/ChangeLog: PR tree-optimization/113588 PR tree-optimization/113467 * tree-vect-data-refs.cc (vect_analyze_data_ref_dependence): Choose correct dest and fix checks. (vect_analyze_early_break_dependences): Update comments. gcc/testsuite/ChangeLog: PR tree-optimization/113588 PR tree-optimization/113467 * gcc.dg/vect/vect-early-break_108-pr113588.c: New test. * gcc.dg/vect/vect-early-break_109-pr113588.c: New test.
Showing
- gcc/testsuite/gcc.dg/vect/vect-early-break_108-pr113588.c 15 additions, 0 deletionsgcc/testsuite/gcc.dg/vect/vect-early-break_108-pr113588.c
- gcc/testsuite/gcc.dg/vect/vect-early-break_109-pr113588.c 44 additions, 0 deletionsgcc/testsuite/gcc.dg/vect/vect-early-break_109-pr113588.c
- gcc/tree-vect-data-refs.cc 45 additions, 47 deletionsgcc/tree-vect-data-refs.cc
Loading
Please register or sign in to comment