public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r10-10499] target/100784 - avoid ICE with folding __builtin_ia32_shufpd
@ 2022-03-16  9:22 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-03-16  9:22 UTC (permalink / raw)
  To: gcc-cvs

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

commit r10-10499-ge0ae287e2c199a22d3f0c2de40a4869a44c8b795
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jan 20 14:34:33 2022 +0100

    target/100784 - avoid ICE with folding __builtin_ia32_shufpd
    
    This avoids ICEing when there is no LHS on the call by following
    what foldings of other builtins do in , namely not folding.
    
    2022-01-20  Richard Biener  <rguenther@suse.de>
    
            PR target/100784
            * config/i386/i386.c (ix86_gimple_fold_builtin): Check for
            LHS before folding __builtin_ia32_shufpd and friends.
    
    (cherry picked from commit d63d9c3dd160dce24f0209f193b8e7388b19f712)

Diff:
---
 gcc/config/i386/i386.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 44e4be58c39..cec0340ec51 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -17911,7 +17911,7 @@ ix86_gimple_fold_builtin (gimple_stmt_iterator *gsi)
 
     case IX86_BUILTIN_SHUFPD:
       arg2 = gimple_call_arg (stmt, 2);
-      if (TREE_CODE (arg2) == INTEGER_CST)
+      if (TREE_CODE (arg2) == INTEGER_CST && gimple_call_lhs (stmt))
 	{
 	  location_t loc = gimple_location (stmt);
 	  unsigned HOST_WIDE_INT imask = TREE_INT_CST_LOW (arg2);


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

only message in thread, other threads:[~2022-03-16  9:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-16  9:22 [gcc r10-10499] target/100784 - avoid ICE with folding __builtin_ia32_shufpd Richard Biener

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