* [Bug target/98914] [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198
2021-02-01 11:31 [Bug target/98914] New: [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198 asolokha at gmx dot com
@ 2021-02-02 8:12 ` rguenth at gcc dot gnu.org
2021-02-03 3:59 ` luoxhu at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-02 8:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98914
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98914] [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198
2021-02-01 11:31 [Bug target/98914] New: [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198 asolokha at gmx dot com
2021-02-02 8:12 ` [Bug target/98914] " rguenth at gcc dot gnu.org
@ 2021-02-03 3:59 ` luoxhu at gcc dot gnu.org
2021-02-03 8:11 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: luoxhu at gcc dot gnu.org @ 2021-02-03 3:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98914
--- Comment #1 from luoxhu at gcc dot gnu.org ---
The type of k in the case should be "long" to reproduce the issue,
ICE happens at
rs6000_expand_vector_set: gcc_assert (GET_MODE (idx) == E_SImode);
Reason is the vector index variable need be "signed int" for all vec_insert
prototype.
ELFv2 ABI:
vector signed char vec_insert (signed char, vector signed char, signed int);
vector unsigned char vec_insert (unsigned char, vector unsigned char, signed
int);
vector signed int vec_insert (signed int, vector signed int, signed int);
vector unsigned int vec_insert (unsigned int, vector unsigned int, signed int);
vector signed long long vec_insert (signed long long, vector signed long long,
signed int);
Not sure all targets like X86/AArch64 also has some requirements, and whether
below fix reasonable to not generate IFN VEC_SET for stmt like
VIEW_CONVERT_EXPR<unsigned char[16]>(v)[k_7] = 170; ?
diff --git a/gcc/gimple-isel.cc b/gcc/gimple-isel.cc
index 2c78a08d3f1..dbbae270a36 100644
--- a/gcc/gimple-isel.cc
+++ b/gcc/gimple-isel.cc
@@ -77,6 +77,7 @@ gimple_expand_vec_set_expr (gimple_stmt_iterator *gsi)
tree view_op0 = TREE_OPERAND (op0, 0);
machine_mode outermode = TYPE_MODE (TREE_TYPE (view_op0));
if (auto_var_in_fn_p (view_op0, cfun->decl)
+ && TYPE_MODE (TREE_TYPE (pos)) == E_SImode
&& !TREE_ADDRESSABLE (view_op0) && can_vec_set_var_idx_p (outermode))
{
location_t loc = gimple_location (stmt);
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98914] [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198
2021-02-01 11:31 [Bug target/98914] New: [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198 asolokha at gmx dot com
2021-02-02 8:12 ` [Bug target/98914] " rguenth at gcc dot gnu.org
2021-02-03 3:59 ` luoxhu at gcc dot gnu.org
@ 2021-02-03 8:11 ` rguenth at gcc dot gnu.org
2021-02-03 8:15 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-03 8:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98914
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
No, I think that's too restrictive. ISTR we wanted to have "arbitrary" index
modes, if the target wants just SImode it can convert_move to it, no?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98914] [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198
2021-02-01 11:31 [Bug target/98914] New: [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198 asolokha at gmx dot com
` (2 preceding siblings ...)
2021-02-03 8:11 ` rguenth at gcc dot gnu.org
@ 2021-02-03 8:15 ` jakub at gcc dot gnu.org
2021-02-04 0:38 ` luoxhu at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-03 8:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98914
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Yeah. The requirement that the index needs to be signed int is fine for the
intrinsics, but not otherwise. And if it is an index into a vector with less
than 128 elements, one shouldn't care if the index is signed or unsigned char,
short, int or long long.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98914] [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198
2021-02-01 11:31 [Bug target/98914] New: [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198 asolokha at gmx dot com
` (3 preceding siblings ...)
2021-02-03 8:15 ` jakub at gcc dot gnu.org
@ 2021-02-04 0:38 ` luoxhu at gcc dot gnu.org
2021-03-22 2:15 ` cvs-commit at gcc dot gnu.org
2021-03-22 2:16 ` luoxhu at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: luoxhu at gcc dot gnu.org @ 2021-02-04 0:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98914
--- Comment #4 from luoxhu at gcc dot gnu.org ---
*** Bug 98958 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98914] [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198
2021-02-01 11:31 [Bug target/98914] New: [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198 asolokha at gmx dot com
` (4 preceding siblings ...)
2021-02-04 0:38 ` luoxhu at gcc dot gnu.org
@ 2021-03-22 2:15 ` cvs-commit at gcc dot gnu.org
2021-03-22 2:16 ` luoxhu at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-22 2:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98914
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Xiong Hu Luo <luoxhu@gcc.gnu.org>:
https://gcc.gnu.org/g:d0a5e8e1a84bdd6ce915c3be65da8af2552cd49e
commit r11-7755-gd0a5e8e1a84bdd6ce915c3be65da8af2552cd49e
Author: Xionghu Luo <luoxhu@linux.ibm.com>
Date: Sun Mar 21 21:14:02 2021 -0500
rs6000: Convert the vector set variable idx to DImode [PR98914]
vec_insert defines the element argument type to be signed int by ELFv2
ABI. When expanding a vector with a variable rtx, convert the rtx type
to DImode to support both intrinsic usage and other callers from
rs6000_expand_vector_init produced by v[k] = val when k is long type.
gcc/ChangeLog:
2021-03-21 Xionghu Luo <luoxhu@linux.ibm.com>
PR target/98914
* config/rs6000/rs6000.c (rs6000_expand_vector_set_var_p9):
Convert idx to DImode.
(rs6000_expand_vector_set_var_p8): Likewise.
gcc/testsuite/ChangeLog:
2021-03-21 Xionghu Luo <luoxhu@linux.ibm.com>
PR target/98914
* gcc.target/powerpc/pr98914.c: New test.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/98914] [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198
2021-02-01 11:31 [Bug target/98914] New: [11 Regression] ICE in rs6000_expand_vector_set, at config/rs6000/rs6000.c:7198 asolokha at gmx dot com
` (5 preceding siblings ...)
2021-03-22 2:15 ` cvs-commit at gcc dot gnu.org
@ 2021-03-22 2:16 ` luoxhu at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: luoxhu at gcc dot gnu.org @ 2021-03-22 2:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98914
luoxhu at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from luoxhu at gcc dot gnu.org ---
Fixed on master.
^ permalink raw reply [flat|nested] 8+ messages in thread