tree-optimization/117041 - fix load classification of former grouped load
commit72c83f644dea755b4eba427aabde45f5d3694d9b
authorRichard Biener <rguenther@suse.de>
Wed, 9 Oct 2024 09:42:59 +0000 (9 11:42 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 9 Oct 2024 12:37:25 +0000 (9 14:37 +0200)
treef0f6bed985ec7a52d22ef212648def6e8b1de7c6
parentcf08dd297ca9e13b46ba4ff203dbcdce49dbc067
tree-optimization/117041 - fix load classification of former grouped load

When we first detect a grouped load but later dis-associate it we
only set DR_GROUP_FIRST_ELEMENT to NULL, indicating it is not a
STMT_VINFO_GROUPED_ACCESS but leave DR_GROUP_NEXT_ELEMENT set.  This
causes a stray DR_GROUP_NEXT_ELEMENT access in get_group_load_store_type
to go wrong, indicating a load isn't single_element_p when it actually
is, leading to wrong classification and an ICE.

PR tree-optimization/117041
* tree-vect-stmts.cc (get_group_load_store_type): Only
check DR_GROUP_NEXT_ELEMENT for STMT_VINFO_GROUPED_ACCESS.

* gcc.dg/torture/pr117041.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr117041.c [new file with mode: 0644]
gcc/tree-vect-stmts.cc