diff options
Diffstat (limited to 'gcc/gimple-fold.cc')
-rw-r--r-- | gcc/gimple-fold.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc index 94d5a1e..5884b79 100644 --- a/gcc/gimple-fold.cc +++ b/gcc/gimple-fold.cc @@ -8334,6 +8334,8 @@ fold_truth_andor_for_ifcombine (enum tree_code code, tree truth_type, ll_and_mask &= sign; if (l_xor) { + if (ll_bitsize != lr_bitsize) + return 0; if (!lr_and_mask.get_precision ()) lr_and_mask = sign; else @@ -8355,6 +8357,8 @@ fold_truth_andor_for_ifcombine (enum tree_code code, tree truth_type, rl_and_mask &= sign; if (r_xor) { + if (rl_bitsize != rr_bitsize) + return 0; if (!rr_and_mask.get_precision ()) rr_and_mask = sign; else @@ -8762,7 +8766,7 @@ fold_truth_andor_for_ifcombine (enum tree_code code, tree truth_type, wide_int lr_mask, rr_mask; if (lr_and_mask.get_precision ()) lr_mask = wi::lshift (wide_int::from (lr_and_mask, rnprec, UNSIGNED), - xlr_bitpos); + xlr_bitpos); else lr_mask = wi::shifted_mask (xlr_bitpos, lr_bitsize, false, rnprec); if (rr_and_mask.get_precision ()) |