rs6000: Fix vec insert ilp32 ICE and test failures [PR98799]
authorXionghu Luo <luoxhu@linux.ibm.com>
Thu, 28 Jan 2021 02:24:03 +0000 (20:24 -0600)
committerXionghu Luo <luoxhu@linux.ibm.com>
Thu, 28 Jan 2021 03:34:08 +0000 (21:34 -0600)
commitfbe37371cf372b84d5b7f1a6f5f0971a513dd5fa
treefaa8d9a8b239467ff6e0c094b12784cd3d62cd0a
parentf76d0d86454baf99ada0748c73a29816854e1b91
rs6000: Fix vec insert ilp32 ICE and test failures [PR98799]

UNSPEC_SI_FROM_SF is not supported when TARGET_DIRECT_MOVE_64BIT
is false for -m32, don't generate VIEW_CONVERT_EXPR(ARRAY_REF) for
variable vector insert.  Remove rs6000_expand_vector_set_var helper
function, adjust the p8 and p9 definitions position and make them
static.

The previous commit r11-6858 missed check m32, This patch is tested pass
on P7BE{m32,m64}/P8BE{m32,m64}/P8LE/P9LE with
RUNTESTFLAGS="--target_board =unix'{-m32,-m64}'" for BE targets.

gcc/ChangeLog:

2021-01-27  Xionghu Luo  <luoxhu@linux.ibm.com>
    David Edelsohn  <dje.gcc@gmail.com>

PR target/98799
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
Don't generate VIEW_CONVERT_EXPR for fcode ALTIVEC_BUILTIN_VEC_INSERT
when -m32.
* config/rs6000/rs6000-protos.h (rs6000_expand_vector_set_var):
Delete.
* config/rs6000/rs6000.c (rs6000_expand_vector_set): Remove the
wrapper call rs6000_expand_vector_set_var for cleanup.  Call
rs6000_expand_vector_set_var_p9 and rs6000_expand_vector_set_var_p8
directly.
(rs6000_expand_vector_set_var): Delete.
(rs6000_expand_vector_set_var_p9): Make static.
(rs6000_expand_vector_set_var_p8): Make static.

gcc/testsuite/ChangeLog:

2021-01-27  Xionghu Luo  <luoxhu@linux.ibm.com>

PR target/98827
* gcc.target/powerpc/fold-vec-insert-char-p8.c: Adjust ilp32.
* gcc.target/powerpc/fold-vec-insert-char-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-double.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-float-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-float-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-int-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-int-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-short-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-short-p9.c: Likewise.
* gcc.target/powerpc/pr79251.p8.c: Likewise.
* gcc.target/powerpc/pr79251.p9.c: Likewise.
* gcc.target/powerpc/vsx-builtin-7.c: Likewise.
* gcc.target/powerpc/pr79251-run.c: Build and run with vsx
option.
17 files changed:
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-char-p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-char-p9.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-double.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-float-p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-float-p9.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-int-p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-int-p9.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-longlong.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-short-p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-short-p9.c
gcc/testsuite/gcc.target/powerpc/pr79251-run.c
gcc/testsuite/gcc.target/powerpc/pr79251.p8.c
gcc/testsuite/gcc.target/powerpc/pr79251.p9.c
gcc/testsuite/gcc.target/powerpc/vsx-builtin-7.c