• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GCC with patches for OS216


Commit MetaInfo

Revisionc84a15b040a179e4ce28fca2636ed88b0503517b (tree)
Zeit1999-10-12 14:44:39
AutorJeffrey A Law <law@cygn...>
CommiterJeff Law

Log Message

regmove.c (fixup_match_1): Don't change an unchanging register.

Thu Sep 2 20:08:23 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
        • regmove.c (fixup_match_1): Don't change an unchanging register.
          (stable_but_for_p): Renamed to:
          (stable_and_no_regs_but_for_p). Reject unchanging registers too.
          Changed all callers.

From-SVN: r29910

Ändern Zusammenfassung

Diff

--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
11 Mon Oct 11 23:35:19 1999 Jeffrey A Law (law@cygnus.com)
22
3+ Thu Sep 2 20:08:23 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
4+ * regmove.c (fixup_match_1): Don't change an unchanging register.
5+ (stable_but_for_p): Renamed to:
6+ (stable_and_no_regs_but_for_p). Reject unchanging registers too.
7+ Changed all callers.
8+
39 Tue Aug 17 22:06:11 1999 Jan Hubicka <hubicka@freesoft.cz>
410 * haifa-sched.c (insn_unit): Fix typo on out of range test.
511 * sched.c (insn_unit): Likewise.
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -62,7 +62,7 @@ static int find_matches PROTO((rtx, struct match *));
6262 static int fixup_match_1 PROTO((rtx, rtx, rtx, rtx, rtx, int, int, int, FILE *))
6363 ;
6464 static int reg_is_remote_constant_p PROTO((rtx, rtx, rtx));
65-static int stable_but_for_p PROTO((rtx, rtx, rtx));
65+static int stable_and_no_regs_but_for_p PROTO((rtx, rtx, rtx));
6666 static int regclass_compatible_p PROTO((int, int));
6767 static int loop_depth;
6868
@@ -1663,6 +1663,12 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
16631663 rtx src_note = find_reg_note (insn, REG_DEAD, src), dst_note;
16641664 int length, s_length, true_loop_depth;
16651665
1666+ /* If SRC is marked as unchanging, we may not change it.
1667+ ??? Maybe we could get better code by removing the unchanging bit
1668+ instead, and changing it back if we don't succeed? */
1669+ if (RTX_UNCHANGING_P (src))
1670+ return 0;
1671+
16661672 if (! src_note)
16671673 {
16681674 /* Look for (set (regX) (op regA constX))
@@ -1679,7 +1685,7 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
16791685 && XEXP (SET_SRC (set), 0) == src
16801686 && GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT)
16811687 insn_const = INTVAL (XEXP (SET_SRC (set), 1));
1682- else if (! stable_but_for_p (SET_SRC (set), src, dst))
1688+ else if (! stable_and_no_regs_but_for_p (SET_SRC (set), src, dst))
16831689 return 0;
16841690 else
16851691 /* We might find a src_note while scanning. */
@@ -2089,10 +2095,16 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
20892095 }
20902096
20912097
2092-/* return nonzero if X is stable but for mentioning SRC or mentioning /
2093- changing DST . If in doubt, presume it is unstable. */
2098+/* return nonzero if X is stable and mentions no regsiters but for
2099+ mentioning SRC or mentioning / changing DST . If in doubt, presume
2100+ it is unstable.
2101+ The rationale is that we want to check if we can move an insn easily
2102+ while just paying attention to SRC and DST. A register is considered
2103+ stable if it has the RTX_UNCHANGING_P bit set, but that would still
2104+ leave the burden to update REG_DEAD / REG_UNUSED notes, so we don't
2105+ want any registers but SRC and DST. */
20942106 static int
2095-stable_but_for_p (x, src, dst)
2107+stable_and_no_regs_but_for_p (x, src, dst)
20962108 rtx x, src, dst;
20972109 {
20982110 RTX_CODE code = GET_CODE (x);
@@ -2103,13 +2115,19 @@ stable_but_for_p (x, src, dst)
21032115 int i;
21042116 char *fmt = GET_RTX_FORMAT (code);
21052117 for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
2106- if (fmt[i] == 'e' && ! stable_but_for_p (XEXP (x, i), src, dst))
2118+ if (fmt[i] == 'e'
2119+ && ! stable_and_no_regs_but_for_p (XEXP (x, i), src, dst))
21072120 return 0;
21082121 return 1;
21092122 }
21102123 case 'o':
2111- if (x == src || x == dst)
2112- return 1;
2124+ if (code == REG)
2125+ return x == src || x == dst;
2126+ /* If this is a MEM, look inside - there might be a register hidden in
2127+ the address of an unchanging MEM. */
2128+ if (code == MEM
2129+ && ! stable_and_no_regs_but_for_p (XEXP (x, 0), src, dst))
2130+ return 0;
21132131 /* fall through */
21142132 default:
21152133 return ! rtx_unstable_p (x);