diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-02-19 10:53:51 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-02-19 10:53:51 +0100 |
commit | 40e90eac9591b388ab335cac5f793906cc9a5b0a (patch) | |
tree | ae0cff8e2a111a3f985e8b1442893617e40733f1 /gcc/expr.c | |
parent | 554cf33034e4a4ba3960a0885f45fa7a919dbd0d (diff) | |
download | gcc-40e90eac9591b388ab335cac5f793906cc9a5b0a.zip gcc-40e90eac9591b388ab335cac5f793906cc9a5b0a.tar.gz gcc-40e90eac9591b388ab335cac5f793906cc9a5b0a.tar.bz2 |
re PR middle-end/42233 (c++ builtin_expect code generation regression)
PR middle-end/42233
* expr.h (jumpifnot, jumpifnot_1, jumpif, jumpif_1, do_jump,
do_jump_1, do_compare_rtx_and_jump): Add PROB argument.
* dojump.c: Include output.h.
(inv): New inline function.
(jumpifnot, jumpifnot_1, jumpif, jumpif_1, do_jump_1, do_jump,
do_jump_by_parts_greater_rtx, do_jump_by_parts_greater,
do_jump_by_parts_zero_rtx, do_jump_by_parts_equality_rtx,
do_jump_by_parts_equality, do_compare_and_jump): Add PROB
argument, pass it down to other calls.
(do_compare_rtx_and_jump): Likewise. If PROB is not -1,
add REG_BR_PROB note to the conditional jump.
* cfgexpand.c (add_reg_br_prob_note): Removed.
(expand_gimple_cond): Don't call it, add the probability
as last argument to jumpif_1/jumpifnot_1.
* Makefile.in (dojump.o): Depend on output.h.
* builtins.c (expand_errno_check): Adjust do_compare_rtx_and_jump
callers.
* expmed.c (emit_store_flag_force, do_cmp_and_jump): Likewise.
* stmt.c (do_jump_if_equal): Likewise.
* cfgrtl.c (rtl_lv_add_condition_to_bb): Likewise.
* loop-unswitch.c (compare_and_jump_seq): Likewise.
* config/rs6000/rs6000.c (rs6000_aix_emit_builtin_unwind_init):
Likewise.
* optabs.c (expand_doubleword_shift, expand_abs): Likewise.
* expr.c (expand_expr_real_1): Adjust do_jump, jumpifnot and
jumpifnot_1 callers.
(expand_expr_real_2): Adjust jumpifnot_1 and do_compare_rtx_and_jump
callers.
(store_expr): Adjust jumpifnot caller.
(store_constructor): Adjust jumpif caller.
From-SVN: r156889
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1,6 +1,6 @@ /* Convert tree expression to rtl instructions, for GNU compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -4551,7 +4551,7 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal) do_pending_stack_adjust (); NO_DEFER_POP; - jumpifnot (TREE_OPERAND (exp, 0), lab1); + jumpifnot (TREE_OPERAND (exp, 0), lab1, -1); store_expr (TREE_OPERAND (exp, 1), target, call_param_p, nontemporal); emit_jump_insn (gen_jump (lab2)); @@ -5547,7 +5547,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) /* Generate a conditional jump to exit the loop. */ exit_cond = build2 (LT_EXPR, integer_type_node, index, hi_index); - jumpif (exit_cond, loop_end); + jumpif (exit_cond, loop_end, -1); /* Update the loop counter, and jump to the head of the loop. */ @@ -8013,7 +8013,8 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, temp = gen_label_rtx (); do_compare_rtx_and_jump (target, cmpop1, comparison_code, - unsignedp, mode, NULL_RTX, NULL_RTX, temp); + unsignedp, mode, NULL_RTX, NULL_RTX, temp, + -1); } emit_move_insn (target, op1); emit_label (temp); @@ -8121,7 +8122,7 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, emit_move_insn (target, const0_rtx); op1 = gen_label_rtx (); - jumpifnot_1 (code, treeop0, treeop1, op1); + jumpifnot_1 (code, treeop0, treeop1, op1, -1); emit_move_insn (target, const1_rtx); @@ -9418,7 +9419,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, emit_move_insn (target, const0_rtx); op1 = gen_label_rtx (); - jumpifnot_1 (code, treeop0, treeop1, op1); + jumpifnot_1 (code, treeop0, treeop1, op1, -1); if (target) emit_move_insn (target, const1_rtx); @@ -9475,7 +9476,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, NO_DEFER_POP; op0 = gen_label_rtx (); op1 = gen_label_rtx (); - jumpifnot (treeop0, op0); + jumpifnot (treeop0, op0, -1); store_expr (treeop1, temp, modifier == EXPAND_STACK_PARM, false); @@ -9521,7 +9522,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, int value = TREE_CODE (rhs) == BIT_IOR_EXPR; do_jump (TREE_OPERAND (rhs, 1), value ? label : 0, - value ? 0 : label); + value ? 0 : label, -1); expand_assignment (lhs, build_int_cst (TREE_TYPE (rhs), value), MOVE_NONTEMPORAL (exp)); do_pending_stack_adjust (); |