+2020-03-12 Richard Sandiford <richard.sandiford@arm.com>
+
+ PR rtl-optimization/90275
+ * cse.c (cse_insn): Delete no-op register moves too.
+
2020-03-12 Darius Galis <darius.galis@cyberthorstudios.com>
* config/rx/rx.md (CTRLREG_CPEN): Remove.
for (i = 0; i < n_sets; i++)
{
bool repeat = false;
- bool mem_noop_insn = false;
+ bool noop_insn = false;
rtx src, dest;
rtx src_folded;
struct table_elt *elt = 0, *p;
}
/* Similarly, lots of targets don't allow no-op
- (set (mem x) (mem x)) moves. */
+ (set (mem x) (mem x)) moves. Even (set (reg x) (reg x))
+ might be impossible for certain registers (like CC registers). */
else if (n_sets == 1
- && MEM_P (trial)
+ && !CALL_P (insn)
+ && (MEM_P (trial) || REG_P (trial))
&& MEM_P (dest)
&& rtx_equal_p (trial, dest)
&& !side_effects_p (dest)
|| insn_nothrow_p (insn)))
{
SET_SRC (sets[i].rtl) = trial;
- mem_noop_insn = true;
+ noop_insn = true;
break;
}
sets[i].rtl = 0;
}
- /* Similarly for no-op MEM moves. */
- else if (mem_noop_insn)
+ /* Similarly for no-op moves. */
+ else if (noop_insn)
{
if (cfun->can_throw_non_call_exceptions && can_throw_internal (insn))
cse_cfg_altered = true;
+2020-03-12 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/90275
+ * gcc.c-torture/compile/pr90275.c: New test.
+
2020-03-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/94103