diff options
Diffstat (limited to 'gcc-4.8/gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc-4.8/gcc/tree-ssa-reassoc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc-4.8/gcc/tree-ssa-reassoc.c b/gcc-4.8/gcc/tree-ssa-reassoc.c index a1a9a7319..e724e181c 100644 --- a/gcc-4.8/gcc/tree-ssa-reassoc.c +++ b/gcc-4.8/gcc/tree-ssa-reassoc.c @@ -785,8 +785,7 @@ eliminate_not_pairs (enum tree_code opcode, if (opcode == BIT_AND_EXPR) oe->op = build_zero_cst (TREE_TYPE (oe->op)); else if (opcode == BIT_IOR_EXPR) - oe->op = build_low_bits_mask (TREE_TYPE (oe->op), - TYPE_PRECISION (TREE_TYPE (oe->op))); + oe->op = build_all_ones_cst (TREE_TYPE (oe->op)); reassociate_stats.ops_eliminated += ops->length () - 1; ops->truncate (0); @@ -1980,6 +1979,13 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange, tem = fold_convert_loc (loc, optype, tem); gsi = gsi_for_stmt (stmt); + /* In rare cases range->exp can be equal to lhs of stmt. + In that case we have to insert after the stmt rather then before + it. */ + if (op == range->exp) + tem = force_gimple_operand_gsi (&gsi, tem, true, NULL_TREE, false, + GSI_SAME_STMT); + else tem = force_gimple_operand_gsi (&gsi, tem, true, NULL_TREE, true, GSI_SAME_STMT); |