aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-02-16 17:50:49 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-02-16 12:50:49 -0500
commitf85cc4cbe2c0fb8d30ba85a849b01d201a751eac (patch)
tree0b19c0ec4e6f1f97a60aaa3fe30067d0fb188301 /gcc/cse.c
parentf0217d415dc04a7c588e48b393d119b7c933f427 (diff)
downloadgcc-f85cc4cbe2c0fb8d30ba85a849b01d201a751eac.zip
gcc-f85cc4cbe2c0fb8d30ba85a849b01d201a751eac.tar.gz
gcc-f85cc4cbe2c0fb8d30ba85a849b01d201a751eac.tar.bz2
cse.c (new_label_ref): New variable.
* cse.c (new_label_ref): New variable. (insert): Set it instead of recorded_label_ref. (cse_basic_block): Set recorded_label_ref if new_label_ref use, has CODE_LABEL for this function, and not already in REG_LABEL note. From-SVN: r39768
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index aacc775..17a597e 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -382,11 +382,14 @@ static int cse_altered;
static int cse_jumps_altered;
-/* Nonzero if we put a LABEL_REF into the hash table. Since we may have put
- it into an INSN without a REG_LABEL, we have to rerun jump after CSE
- to put in the note. */
+/* Nonzero if we put a LABEL_REF into the hash table for an INSN without a
+ REG_LABEL, we have to rerun jump after CSE to put in the note. */
static int recorded_label_ref;
+/* Says which LABEL_REF was put in the hash table. Used to see if we need
+ to set the above flag. */
+static rtx new_label_ref;
+
/* canon_hash stores 1 in do_not_record
if it notices a reference to CC0, PC, or some other volatile
subexpression. */
@@ -1581,7 +1584,7 @@ insert (x, classp, hash, mode)
if (GET_CODE (x) == LABEL_REF
|| (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == LABEL_REF))
- recorded_label_ref = 1;
+ new_label_ref = x;
/* Put an element for X into the right hash bucket. */
@@ -7308,7 +7311,17 @@ cse_basic_block (from, to, next_branch, around_loop)
libcall_insn = 0;
}
+ new_label_ref = 0;
cse_insn (insn, libcall_insn);
+
+ /* If this insn uses a LABEL_REF and there isn't a REG_LABEL
+ note for it, we must rerun jump since it needs to place the
+ note. If this is a LABEL_REF for a CODE_LABEL that isn't in
+ the insn chain, don't do this since no REG_LABEL will be added. */
+ if (new_label_ref != 0 && INSN_UID (XEXP (new_label_ref, 0)) != 0
+ && reg_mentioned_p (new_label_ref, PATTERN (insn))
+ && ! find_reg_note (insn, REG_LABEL, XEXP (new_label_ref, 0)))
+ recorded_label_ref = 1;
}
/* If INSN is now an unconditional jump, skip to the end of our