public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5780] s390: Fix ICE in testcase pr89233
@ 2023-11-23 14:32 Andreas Krebbel
0 siblings, 0 replies; only message in thread
From: Andreas Krebbel @ 2023-11-23 14:32 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2add85eeb01cb3d5db841a3d271bd7c37a77dba1
commit r14-5780-g2add85eeb01cb3d5db841a3d271bd7c37a77dba1
Author: Juergen Christ <jchrist@linux.ibm.com>
Date: Mon Nov 20 09:12:18 2023 +0100
s390: Fix ICE in testcase pr89233
When using GNU vector extensions, an access outside of the vector size
caused an ICE on s390. Fix this by aligning with the vec_extract
builtin, i.e., computing constant index modulo number of lanes.
Fixes testcase gcc.target/s390/pr89233.c.
gcc/ChangeLog:
* config/s390/vector.md: (*vec_extract) Fix.
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Diff:
---
gcc/config/s390/vector.md | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
index 4f4c9d96b3d..626ec118229 100644
--- a/gcc/config/s390/vector.md
+++ b/gcc/config/s390/vector.md
@@ -531,12 +531,14 @@
(match_operand:V 1 "nonmemory_operand" "v,v")
(parallel
[(match_operand:SI 2 "nonmemory_operand" "an,I")])))]
- "TARGET_VX
- && (!CONST_INT_P (operands[2])
- || UINTVAL (operands[2]) < GET_MODE_NUNITS (<V:MODE>mode))"
- "@
- vlgv<bhfgq>\t%0,%v1,%Y2
- vste<bhfgq>\t%v1,%0,%2"
+ "TARGET_VX"
+ {
+ if (CONST_INT_P (operands[2]))
+ operands[2] = GEN_INT (UINTVAL (operands[2]) & (GET_MODE_NUNITS (<V:MODE>mode) - 1));
+ if (which_alternative == 0)
+ return "vlgv<bhfgq>\t%0,%v1,%Y2";
+ return "vste<bhfgq>\t%v1,%0,%2";
+ }
[(set_attr "op_type" "VRS,VRX")])
; vlgvb, vlgvh, vlgvf, vlgvg
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-23 14:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23 14:32 [gcc r14-5780] s390: Fix ICE in testcase pr89233 Andreas Krebbel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).