From: Peter Bergner Date: Mon, 20 Mar 2023 14:12:47 +0000 (-0500) Subject: rs6000: Don't ICE when compiling the __builtin_vec_xst_trunc built-in [PR109178] X-Git-Tag: basepoints/gcc-14~446 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbd50e867e6a782c7b56c9727bf7e1e74dae4b94;p=thirdparty%2Fgcc.git rs6000: Don't ICE when compiling the __builtin_vec_xst_trunc built-in [PR109178] When we expand the __builtin_vec_xst_trunc built-in, we use the wrong mode for the MEM operand which causes an unrecognizable insn ICE. The solution is to use the correct TMODE mode. 2023-03-20 Peter Bergner gcc/ PR target/109178 * config/rs6000/rs6000-builtin.cc (stv_expand_builtin): Use tmode. gcc/testsuite/ PR target/109178 * gcc.target/powerpc/pr109178.c: New test. --- diff --git a/gcc/config/rs6000/rs6000-builtin.cc b/gcc/config/rs6000/rs6000-builtin.cc index 737a5c42bfb8..83c28cd8af32 100644 --- a/gcc/config/rs6000/rs6000-builtin.cc +++ b/gcc/config/rs6000/rs6000-builtin.cc @@ -2933,7 +2933,7 @@ stv_expand_builtin (insn_code icode, rtx *op, rtx addr; if (op[1] == const0_rtx) - addr = gen_rtx_MEM (Pmode, op[2]); + addr = gen_rtx_MEM (tmode, op[2]); else { op[1] = copy_to_mode_reg (Pmode, op[1]); diff --git a/gcc/testsuite/gcc.target/powerpc/pr109178.c b/gcc/testsuite/gcc.target/powerpc/pr109178.c new file mode 100644 index 000000000000..0f6e2d6b2eb4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr109178.c @@ -0,0 +1,13 @@ +/* PR target/109178 */ +/* { dg-require-effective-target int128 } */ +/* { dg-options "-O2 -mdejagnu-cpu=power10" } */ + +/* Verify we do not ICE on the following. */ + +typedef __attribute__ ((altivec (vector__))) signed __int128 v1ti_t; + +void +foo (signed int *dst, v1ti_t src) +{ + __builtin_vec_xst_trunc(src, 0, dst); +}