[Bug target/100887] [12 Regression] ICE: in ix86_expand_vector_init_concat, at config/i386/i386-expand.c:14178 with -mavx512f and __builtin_shufflevector()
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue May 10 08:18:29 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100887
--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:74b7d769e3cc1b18509103a6ac6466713858a376
commit r10-10617-g74b7d769e3cc1b18509103a6ac6466713858a376
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Jun 7 09:28:31 2021 +0200
fold-const: Fix up fold_read_from_vector [PR100887]
The callers of fold_read_from_vector expect that the index they pass is
an index of an element in the vector and the function does that most of the
time. But we allow CONSTRUCTORs with VECTOR_TYPE to have VECTOR_TYPE
elements and in that case every CONSTRUCTOR element represents not just one
index (with the exception of V1 vectors), but multiple.
So returning zero vector if i >= CONSTRUCTOR_NELTS or returning some
CONSTRUCTOR_ELT's value might not be what the callers expect.
Fixed by punting if the first element has vector type.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
In theory we could instead recurse (and assert that for CONSTRUCTORs of
vector elements we have always all elements specified like tree-cfg.c
verifies?) after adjusting the index appropriately.
2021-06-07 Jakub Jelinek <jakub@redhat.com>
PR target/100887
* fold-const.c (fold_read_from_vector): Return NULL if trying to
read from a CONSTRUCTOR with vector type elements.
(cherry picked from commit e1521b170b44be5cd5d36a98b6b760457b68f566)
More information about the Gcc-bugs
mailing list