https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79389
--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Thu Feb 23 22:05:19 2017 New Revision: 245690 URL: https://gcc.gnu.org/viewcvs?rev=245690&root=gcc&view=rev Log: PR tree-optimization/79389 * ifcvt.c (struct noce_if_info): Add rev_cond field. (noce_reversed_cond_code): New function. (noce_emit_store_flag): Use rev_cond if non-NULL instead of reversed_comparison_code. Formatting fix. (noce_try_store_flag): Test rev_cond != NULL in addition to reversed_comparison_code. (noce_try_store_flag_constants): Likewise. (noce_try_store_flag_mask): Likewise. (noce_try_addcc): Use rev_cond if non-NULL instead of reversed_comparison_code. (noce_try_cmove_arith): Likewise. Formatting fixes. (noce_try_minmax, noce_try_abs): Clear rev_cond. (noce_find_if_block): Initialize rev_cond. (find_cond_trap): Call noce_get_condition with then_bb == trap_bb instead of false as last argument never attempt to reverse it afterwards. Modified: trunk/gcc/ChangeLog trunk/gcc/ifcvt.c