diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-31 16:51:33 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-31 16:51:33 +0000 |
commit | 9fa5b473b5b8e289b6542adfd5cfaddfb3036048 (patch) | |
tree | 9de2507dc2fad33cd02214bcdd24b6deac975760 /gcc/tree-vect-patterns.c | |
parent | 0411210fddbd3ec27c8dc1183f40f662712a2232 (diff) | |
download | gcc-9fa5b473b5b8e289b6542adfd5cfaddfb3036048.zip gcc-9fa5b473b5b8e289b6542adfd5cfaddfb3036048.tar.gz gcc-9fa5b473b5b8e289b6542adfd5cfaddfb3036048.tar.bz2 |
vect: Fix bogus alignment assumption in alias checks [PR94994]
This PR is about a case in which the vectoriser was feeding
incorrect alignment information to tree-data-ref.c, leading
to incorrect runtime alias checks. The alignment was taken
from the TREE_TYPE of the DR_REF, which in this case was a
COMPONENT_REF with a normally-aligned type. However, the
underlying MEM_REF was only byte-aligned.
This patch uses dr_alignment to calculate the (byte) alignment
instead, just like we do when creating vector MEM_REFs.
gcc/
PR tree-optimization/94994
* tree-vect-data-refs.c (vect_vfa_align): Use dr_alignment.
gcc/testsuite/
PR tree-optimization/94994
* gcc.dg/vect/pr94994.c: New test.
Diffstat (limited to 'gcc/tree-vect-patterns.c')
0 files changed, 0 insertions, 0 deletions