forwprop: Fix ICE when building a VEC_PERM_EXPR [PR94683]
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 21 Apr 2020 15:11:07 +0000 (16:11 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 21 Apr 2020 15:11:07 +0000 (16:11 +0100)
commit85353e24ca90282e1d3620682841f524de20475c
tree46688d72def322254f2c555f54ce7e7266956221
parent619602346aed9dae3f338d9f18767414446adf78
forwprop: Fix ICE when building a VEC_PERM_EXPR [PR94683]

The type compatibility handling in simplify_vector_constructor is
based on the number of elements and on element type compatibility,
but that's no longer enough to ensure that two vector types are
compatible.  This patch uses a VIEW_CONVERT_EXPR if the permutation
type and result type are distinct.

2020-04-21  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/94683
* tree-ssa-forwprop.c (simplify_vector_constructor): Use a
VIEW_CONVERT_EXPR to handle mixtures of similarly-structured
but distinct vector types.

gcc/testsuite/
PR tree-optimization/94683
* gcc.target/aarch64/sve/acle/general/pr94683.c: New test.
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr94683.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c