aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-05-20 21:14:23 +0000
committerAndrew Pinski <apinski@marvell.com>2023-05-21 01:11:24 +0000
commitee0f1f2294baaecfa0c038fe7e8361949d1ebd68 (patch)
tree3422ef503570afca019b537a8a0d96b855eb245f /gcc/expr.cc
parent7f6e0816f0f5b1e59d05fc96364dec97011f1295 (diff)
downloadgcc-ee0f1f2294baaecfa0c038fe7e8361949d1ebd68.zip
gcc-ee0f1f2294baaecfa0c038fe7e8361949d1ebd68.tar.gz
gcc-ee0f1f2294baaecfa0c038fe7e8361949d1ebd68.tar.bz2
Fix PR 109919: ICE in emit_move_insn with some bit tests
The problem is I used expand_expr with the target but we don't want to use the target here as it is the wrong mode for the original expression. The testcase would ICE deap down while trying to do a move to use the target. Anyways just calling expand_expr with NULL_EXPR fixes the issue. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR middle-end/109919 gcc/ChangeLog: * expr.cc (expand_single_bit_test): Don't use the target for expand_expr. gcc/testsuite/ChangeLog: * gcc.c-torture/compile/pr109919-1.c: New test.
Diffstat (limited to 'gcc/expr.cc')
-rw-r--r--gcc/expr.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/expr.cc b/gcc/expr.cc
index 6849c96..30c58c8 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -12956,7 +12956,7 @@ expand_single_bit_test (location_t loc, enum tree_code code,
intermediate_type = ops_unsigned ? unsigned_type : signed_type;
inner = fold_convert_loc (loc, intermediate_type, inner);
- rtx inner0 = expand_expr (inner, target, VOIDmode, EXPAND_NORMAL);
+ rtx inner0 = expand_expr (inner, NULL_RTX, VOIDmode, EXPAND_NORMAL);
inner0 = extract_bit_field (inner0, 1, bitnum, 1, target,
operand_mode, mode, 0, NULL);