public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] rs6000: Properly handle LE index munging in vec_shr (PR94710)
@ 2020-09-18 18:16 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2020-09-18 18:16 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ff635dd02ad157de312e0e5bb89bb8115bab40c8

commit ff635dd02ad157de312e0e5bb89bb8115bab40c8
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Fri Apr 24 13:33:14 2020 +0000

    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.
    
    (cherry picked from commit 9c725245beed2f056b67f5dc218fef6cb869c5f2)

Diff:
---
 gcc/config/rs6000/vector.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/vector.md b/gcc/config/rs6000/vector.md
index 21743c6be26..fa9c1616634 100644
--- a/gcc/config/rs6000/vector.md
+++ b/gcc/config/rs6000/vector.md
@@ -1227,7 +1227,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];
     }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-18 18:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 18:16 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] rs6000: Properly handle LE index munging in vec_shr (PR94710) Jakub Jelinek

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).