Commit 17ac08e2 by Ian Lance Taylor Committed by Ian Lance Taylor

final.c (final_scan_insn): Don't remove no-op instructions.

	* final.c (final_scan_insn): Don't remove no-op instructions.
	* reload1.c (reload): Remove simple no-op instructions even when
	not optimizing.

From-SVN: r96933
parent 0e6b0daf
2005-03-23 Ian Lance Taylor <ian@airs.com>
* final.c (final_scan_insn): Don't remove no-op instructions.
* reload1.c (reload): Remove simple no-op instructions even when
not optimizing.
2005-03-23 Dorit Naishlos <dorit@il.ib.com> 2005-03-23 Dorit Naishlos <dorit@il.ib.com>
PR tree-optimization/20501 PR tree-optimization/20501
......
/* Convert RTL to assembler code and output it, for GNU compiler. /* Convert RTL to assembler code and output it, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -2267,20 +2268,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2267,20 +2268,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
} }
#endif #endif
#ifndef STACK_REGS
/* Don't bother outputting obvious no-ops, even without -O.
This optimization is fast and doesn't interfere with debugging.
Don't do this if the insn is in a delay slot, since this
will cause an improper number of delay insns to be written. */
if (final_sequence == 0
&& prescan >= 0
&& NONJUMP_INSN_P (insn) && GET_CODE (body) == SET
&& REG_P (SET_SRC (body))
&& REG_P (SET_DEST (body))
&& REGNO (SET_SRC (body)) == REGNO (SET_DEST (body)))
break;
#endif
#ifdef HAVE_cc0 #ifdef HAVE_cc0
/* If this is a conditional branch, maybe modify it /* If this is a conditional branch, maybe modify it
if the cc's are in a nonstandard state if the cc's are in a nonstandard state
......
...@@ -1174,6 +1174,19 @@ reload (rtx first, int global) ...@@ -1174,6 +1174,19 @@ reload (rtx first, int global)
replace_pseudos_in (& XEXP (PATTERN (insn), 0), replace_pseudos_in (& XEXP (PATTERN (insn), 0),
VOIDmode, PATTERN (insn)); VOIDmode, PATTERN (insn));
/* Discard obvious no-ops, even without -O. This optimization
is fast and doesn't interfere with debugging. */
if (NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == SET
&& REG_P (SET_SRC (PATTERN (insn)))
&& REG_P (SET_DEST (PATTERN (insn)))
&& (REGNO (SET_SRC (PATTERN (insn)))
== REGNO (SET_DEST (PATTERN (insn)))))
{
delete_insn (insn);
continue;
}
pnote = &REG_NOTES (insn); pnote = &REG_NOTES (insn);
while (*pnote != 0) while (*pnote != 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment