aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2020-04-24 13:33:14 +0000
committerSegher Boessenkool <segher@kernel.crashing.org>2020-04-24 18:55:32 +0000
commit9c725245beed2f056b67f5dc218fef6cb869c5f2 (patch)
treeb6d2447f5e39505435f723d8c8b6b0d67b2b2560 /gcc
parent9407f0c32b215d55d3474a234b0043bddc185b1c (diff)
downloadgcc-9c725245beed2f056b67f5dc218fef6cb869c5f2.zip
gcc-9c725245beed2f056b67f5dc218fef6cb869c5f2.tar.gz
gcc-9c725245beed2f056b67f5dc218fef6cb869c5f2.tar.bz2
rs6000: Properly handle LE index munging in vec_shr (PR94710)
The PR shows the compiler crashing with -mvsx -mlittle -O0. This turns out to be caused by a failure to make of the higher bits in an index endian conversion. 2020-04-24 Segher Boessenkool <segher@kernel.crashing.org> PR target/94710 * config/rs6000/vector.md (vec_shr_<mode> for VEC_L): Correct little endian byteshift_val calculation.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/rs6000/vector.md3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2db3413..4b6456e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-24 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/94710
+ * config/rs6000/vector.md (vec_shr_<mode> for VEC_L): Correct little
+ endian byteshift_val calculation.
+
2020-04-24 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn.md (*mov<mode>_insn): Only split post-reload.
diff --git a/gcc/config/rs6000/vector.md b/gcc/config/rs6000/vector.md
index 5bc8f80..662521e 100644
--- a/gcc/config/rs6000/vector.md
+++ b/gcc/config/rs6000/vector.md
@@ -1426,7 +1426,8 @@
emit_move_insn (zero_reg, CONST0_RTX (<MODE>mode));
if (!BYTES_BIG_ENDIAN)
{
- byteshift_val = 16 - byteshift_val;
+ /* Note, byteshift_val can be 0! */
+ byteshift_val = -byteshift_val & 15;
op1 = zero_reg;
op2 = operands[1];
}