diff options
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r-- | gcc/ifcvt.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 549c0995768..4fd98d010d3 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -45,6 +45,7 @@ #include "df.h" #include "vec.h" #include "vecprim.h" +#include "dbgcnt.h" #ifndef HAVE_conditional_execution #define HAVE_conditional_execution 0 @@ -2244,6 +2245,7 @@ noce_process_if_block (struct noce_if_info *if_info) || !NONJUMP_INSN_P (insn_b) || (set_b = single_set (insn_b)) == NULL_RTX || ! rtx_equal_p (x, SET_DEST (set_b)) + || ! noce_operand_ok (SET_SRC (set_b)) || reg_overlap_mentioned_p (x, SET_SRC (set_b)) || modified_between_p (SET_SRC (set_b), PREV_INSN (if_info->cond_earliest), jump) @@ -2289,6 +2291,7 @@ noce_process_if_block (struct noce_if_info *if_info) if (! noce_operand_ok (a) || ! noce_operand_ok (b)) return FALSE; + retry: /* Set up the info block for our subroutines. */ if_info->insn_a = insn_a; if_info->insn_b = insn_b; @@ -2386,6 +2389,13 @@ noce_process_if_block (struct noce_if_info *if_info) goto success; } + if (!else_bb && set_b) + { + insn_b = set_b = NULL_RTX; + b = orig_x; + goto retry; + } + return FALSE; success: @@ -4109,7 +4119,8 @@ if_convert (void) static bool gate_handle_if_conversion (void) { - return (optimize > 0); + return (optimize > 0) + && dbg_cnt (if_conversion); } /* If-conversion and CFG cleanup. */ @@ -4149,7 +4160,8 @@ struct tree_opt_pass pass_rtl_ifcvt = static bool gate_handle_if_after_combine (void) { - return (optimize > 0 && flag_if_conversion); + return optimize > 0 && flag_if_conversion + && dbg_cnt (if_after_combine); } @@ -4185,7 +4197,8 @@ struct tree_opt_pass pass_if_after_combine = static bool gate_handle_if_after_reload (void) { - return (optimize > 0 && flag_if_conversion2); + return optimize > 0 && flag_if_conversion2 + && dbg_cnt (if_after_reload); } static unsigned int |