]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
target/100784 - avoid ICE with folding __builtin_ia32_shufpd
authorRichard Biener <rguenther@suse.de>
Thu, 20 Jan 2022 13:34:33 +0000 (14:34 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 16 Mar 2022 08:29:45 +0000 (09:29 +0100)
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)

gcc/config/i386/i386.c

index 44e4be58c39ea41a828998c03677e8f63671c7b4..cec0340ec51fab09b0ae287b4a1146502d0d7043 100644 (file)
@@ -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);