+2016-05-11 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR middle-end/70807
+ * cfgrtl.h (delete_insn_and_edges): Now return bool.
+ * cfgrtl.c (delete_insn_and_edges): Likewise.
+ * config/i386/i386.c (convert_scalars_to_vector): Remove
+ redundant code.
+ * cse.c (cse_insn): Compute cse_cfg_altered.
+ (delete_trivially_dead_insns): Likewise.
+ (cse_cc_succs): Likewise.
+ (rest_of_handle_cse): Free dominance info if required.
+ (rest_of_handle_cse2): Likewise.
+ (rest_of_handle_cse_after_global_opts): Likewise.
+
2016-05-11 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (is_complex_IBM_long_double,
}
}
-/* Like delete_insn but also purge dead edges from BB. */
+/* Like delete_insn but also purge dead edges from BB.
+ Return true if any edges are eliminated. */
-void
+bool
delete_insn_and_edges (rtx_insn *insn)
{
bool purge = false;
purge = true;
delete_insn (insn);
if (purge)
- purge_dead_edges (BLOCK_FOR_INSN (insn));
+ return purge_dead_edges (BLOCK_FOR_INSN (insn));
+ return false;
}
/* Unlink a chain of insns between START and FINISH, leaving notes
#define GCC_CFGRTL_H
extern void delete_insn (rtx);
-extern void delete_insn_and_edges (rtx_insn *);
+extern bool delete_insn_and_edges (rtx_insn *);
extern void delete_insn_chain (rtx, rtx, bool);
extern basic_block create_basic_block_structure (rtx_insn *, rtx_insn *,
rtx_note *, basic_block);
bitmap_obstack_release (NULL);
df_process_deferred_rescans ();
- /* FIXME: Since the CSE pass may change dominance info, which isn't
- expected by the fwprop pass, call free_dominance_info to
- invalidate dominance info. Otherwise, the fwprop pass may crash
- when dominance info is changed. */
- if (TARGET_64BIT)
- free_dominance_info (CDI_DOMINATORS);
-
/* Conversion means we may have 128bit register spills/fills
which require aligned stack. */
if (converted_insns)
else if (n_sets == 1 && dest == pc_rtx && src == pc_rtx)
{
/* One less use of the label this insn used to jump to. */
- delete_insn_and_edges (insn);
+ cse_cfg_altered |= delete_insn_and_edges (insn);
cse_jumps_altered = true;
/* No more processing for this set. */
sets[i].rtl = 0;
{
if (cfun->can_throw_non_call_exceptions && can_throw_internal (insn))
cse_cfg_altered = true;
- delete_insn_and_edges (insn);
+ cse_cfg_altered |= delete_insn_and_edges (insn);
/* No more processing for this set. */
sets[i].rtl = 0;
}
REG_NOTES (new_rtx) = note;
}
- delete_insn_and_edges (insn);
+ cse_cfg_altered |= delete_insn_and_edges (insn);
insn = new_rtx;
}
else
count_reg_usage (insn, counts, NULL_RTX, -1);
ndead++;
}
- delete_insn_and_edges (insn);
+ cse_cfg_altered |= delete_insn_and_edges (insn);
}
}
newreg);
}
- delete_insn_and_edges (insns[i]);
+ cse_cfg_altered |= delete_insn_and_edges (insns[i]);
}
return mode;
else if (tem == 1 || optimize > 1)
cleanup_cfg (0);
+ if (cse_cfg_altered && dom_info_available_p (CDI_DOMINATORS))
+ free_dominance_info (CDI_DOMINATORS);
+
return 0;
}
else if (tem == 1)
cleanup_cfg (0);
+ if (cse_cfg_altered && dom_info_available_p (CDI_DOMINATORS))
+ free_dominance_info (CDI_DOMINATORS);
+
cse_not_expected = 1;
return 0;
}
rebuild_jump_labels (get_insns ());
tem = cse_main (get_insns (), max_reg_num ());
- purge_all_dead_edges ();
+ cse_cfg_altered |= purge_all_dead_edges ();
delete_trivially_dead_insns (get_insns (), max_reg_num ());
cse_not_expected = !flag_rerun_cse_after_loop;
else if (tem == 1)
cleanup_cfg (0);
+ if (cse_cfg_altered && dom_info_available_p (CDI_DOMINATORS))
+ free_dominance_info (CDI_DOMINATORS);
+
flag_cse_follow_jumps = save_cfj;
return 0;
}
+2016-05-11 Ilya Enkovich <ilya.enkovich@intel.com>
+
+ PR middle-end/70807
+ * gcc.dg/pr70807.c: New test.
+
2016-05-10 Martin Sebor <msebor@redhat.com>
PR c++/38611
--- /dev/null
+/* PR middle-end/70807 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef int INT;
+int a, b, c, d, e, f;
+void fn1() {
+ INT g;
+ if (d && a)
+ ;
+ else if (e && b)
+ ;
+ else if (!a && !b && c)
+ ;
+ else if (b && d || a && e)
+ a = 0;
+ f = g || d;
+}