From 556c714b3d1e4350f9b5e747f879cef4775adb93 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Wed, 24 Dec 1997 22:54:37 +0000 Subject: [PATCH] cse.c (max_insn_uid): New variable. * cse.c (max_insn_uid): New variable. (invalidate): Remove CYGNUS LOCAL patch. (cse_around_loop): Use max_insn_uid. (cse_main): Set max_insn_uid. From-SVN: r17231 --- gcc/ChangeLog | 5 +++++ gcc/cse.c | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 575f9a569a1..1926629f190 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -4,6 +4,11 @@ Wed Dec 24 23:33:17 1997 Jeffrey A Law (law@cygnus.com) Wed Dec 24 23:12:14 1997 Jim Wilson + * cse.c (max_insn_uid): New variable. + (invalidate): Remove CYGNUS LOCAL patch. + (cse_around_loop): Use max_insn_uid. + (cse_main): Set max_insn_uid. + * abi64.h (LONG_MAX_SPEC): Check MIPS_ABI_DEFAULT and TARGET_DEFAULT, and define __LONG_MAX__ appropriately. Add support for -mabi=X, -mlong64, and -mgp{32,64} options. diff --git a/gcc/cse.c b/gcc/cse.c index 247a3d8c40c..ca1b6489445 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -193,6 +193,11 @@ Related expressions: static int max_reg; +/* One plus largest instruction UID used in this function at time of + cse_main call. */ + +static int max_insn_uid; + /* Length of vectors indexed by quantity number. We know in advance we will not need a quantity number this big. */ @@ -7798,10 +7803,16 @@ cse_around_loop (loop_start) The only thing we do with SET_DEST is invalidate entries, so we can safely process each SET in order. It is slightly less efficient - to do so, but we only want to handle the most common cases. */ + to do so, but we only want to handle the most common cases. + + The gen_move_insn call in cse_set_around_loop may create new pseudos. + These pseudos won't have valid entries in any of the tables indexed + by register number, such as reg_qty. We avoid out-of-range array + accesses by not processing any instructions created after cse started. */ for (insn = NEXT_INSN (loop_start); GET_CODE (insn) != CALL_INSN && GET_CODE (insn) != CODE_LABEL + && INSN_UID (insn) < max_insn_uid && ! (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END); insn = NEXT_INSN (insn)) @@ -8248,6 +8259,8 @@ cse_main (f, nregs, after_loop, file) max_reg = nregs; + max_insn_uid = get_max_uid (); + all_minus_one = (int *) alloca (nregs * sizeof (int)); consec_ints = (int *) alloca (nregs * sizeof (int)); -- 2.30.2