This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[sh patch] Remove usage of LOG_LINKS
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 15 Feb 2007 09:42:10 +0100
- Subject: [sh patch] Remove usage of LOG_LINKS
LOG_LINKS are now used only in combine and always NULL everywhere else.
Therefore the attached patch against df-branch should be a nop.
Kaz, can you test it on real hardware?
Thanks in advance,
Paolo
Index: gcc-test-df/peak-gcc-src/gcc/config/sh/sh.c
===================================================================
--- gcc-test-df/peak-gcc-src/gcc/config/sh/sh.c (revision 121944)
+++ gcc-test-df/peak-gcc-src/gcc/config/sh/sh.c (working copy)
@@ -4784,33 +4784,7 @@ sh_reorg (void)
if (GET_CODE (reg) != REG)
continue;
- /* This is a function call via REG. If the only uses of REG
- between the time that it is set and the time that it dies
- are in function calls, then we can associate all the
- function calls with the setting of REG. */
-
- for (link = LOG_LINKS (insn); link; link = XEXP (link, 1))
- {
- rtx linked_insn;
-
- if (REG_NOTE_KIND (link) != 0)
- continue;
- linked_insn = XEXP (link, 0);
- set = single_set (linked_insn);
- if (set
- && rtx_equal_p (reg, SET_DEST (set))
- && ! INSN_DELETED_P (linked_insn))
- {
- link = linked_insn;
- break;
- }
- }
-
- if (! link)
- {
- /* ??? Sometimes global register allocation will have
- deleted the insn pointed to by LOG_LINKS. Try
- scanning backward to find where the register is set. */
+ /* Try scanning backward to find where the register is set. */
for (scan = PREV_INSN (insn);
scan && GET_CODE (scan) != CODE_LABEL;
scan = PREV_INSN (scan))
@@ -4830,7 +4804,6 @@ sh_reorg (void)
break;
}
}
- }
if (! link)
continue;
@@ -4860,7 +4833,7 @@ sh_reorg (void)
/* Don't try to trace forward past a CODE_LABEL if we haven't
seen INSN yet. Ordinarily, we will only find the setting insn
- in LOG_LINKS if it is in the same basic block. However,
+ if it is in the same basic block. However,
cross-jumping can insert code labels in between the load and
the call, and can result in situations where a single call
insn may have two targets depending on where we came from. */
@@ -4907,11 +4880,8 @@ sh_reorg (void)
later insn. */
/* ??? We shouldn't have to use FOUNDINSN here.
- However, the LOG_LINKS fields are apparently not
- entirely reliable around libcalls;
- newlib/libm/math/e_pow.c is a test case. Sometimes
- an insn will appear in LOG_LINKS even though it is
- not the most recent insn which sets the register. */
+ This dates back to when we used LOG_LINKS to find
+ the most recent insn which sets the register. */
if (foundinsn
&& (scanset