]> gcc.gnu.org Git - gcc.git/commit
veclower: Don't ICE on .VEC_CONVERT calls with no lhs [PR96426]
authorJakub Jelinek <jakub@redhat.com>
Tue, 4 Aug 2020 09:33:18 +0000 (11:33 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 16 Sep 2020 17:43:03 +0000 (19:43 +0200)
commit3f804f63cde54ff94f35abd00953b050a4c861c7
treefcfafda113a8eabd7faae487f13cf045883a081b
parentfdcb6dae610aba75e23c1fd2d31b491691e54091
veclower: Don't ICE on .VEC_CONVERT calls with no lhs [PR96426]

.VEC_CONVERT is a const internal call, so normally if the lhs is not used,
we'd DCE it far before getting to veclower, but with -O0 (or perhaps
-fno-tree-dce and some other -fno-* options) it can happen.
But as the internal fn needs the lhs to know the type to which the
conversion is done (and I think that is a reasonable representation, having
some magic another argument and having to create constants with that type
looks overkill to me), we just should DCE those calls ourselves.
During veclower, we can't really remove insns, as the callers would be
upset, so this just replaces it with a GIMPLE_NOP.

2020-08-04  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/96426
* tree-vect-generic.c (expand_vector_conversion): Replace .VEC_CONVERT
call with GIMPLE_NOP if there is no lhs.

* gcc.c-torture/compile/pr96426.c: New test.

(cherry picked from commit 95f5a3258dd8a9584f2b10304f79441ef2d4c64c)
gcc/testsuite/gcc.c-torture/compile/pr96426.c [new file with mode: 0644]
gcc/tree-vect-generic.c
This page took 0.065319 seconds and 6 git commands to generate.