aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-01-20 14:34:33 +0100
committerRichard Biener <rguenther@suse.de>2022-01-20 15:19:15 +0100
commitd63d9c3dd160dce24f0209f193b8e7388b19f712 (patch)
tree51a2d7920b92d2d21e2c31a8a6eea1d869b9f10e /gcc
parentce9e0cc5da4c557e4af598fd0a2d087d644bdfc9 (diff)
downloadgcc-d63d9c3dd160dce24f0209f193b8e7388b19f712.zip
gcc-d63d9c3dd160dce24f0209f193b8e7388b19f712.tar.gz
gcc-d63d9c3dd160dce24f0209f193b8e7388b19f712.tar.bz2
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.cc (ix86_gimple_fold_builtin): Check for LHS before folding __builtin_ia32_shufpd and friends.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/i386.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index af82886..ad5a5ca 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -18710,7 +18710,7 @@ ix86_gimple_fold_builtin (gimple_stmt_iterator *gsi)
gimple_call_arg (stmt, n_args - 1)))
break;
arg2 = gimple_call_arg (stmt, 2);
- if (TREE_CODE (arg2) == INTEGER_CST)
+ if (TREE_CODE (arg2) == INTEGER_CST && gimple_call_lhs (stmt))
{
unsigned HOST_WIDE_INT shuffle_mask = TREE_INT_CST_LOW (arg2);
/* Check valid imm, refer to gcc.target/i386/testimm-10.c. */