This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch applied to final.c
- To: egcs-patches at egcs dot cygnus dot com
- Subject: patch applied to final.c
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Tue, 27 Apr 1999 20:50:52 +0100 (BST)
- Cc: amylaar at cygnus dot co dot uk
Reviewed by Jim Wilson.
Sun Apr 25 03:17:33 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* final.c (insn_lengths_max_uid): New variable.
(init_insn_lengths, shorten_branches): Set it.
(get_attr_lengths): Test insn uid against insn_lengths_max_uid.
Index: final.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/final.c,v
retrieving revision 1.167
diff -p -r1.167 final.c
*** final.c 1999/01/20 17:50:22 1.167
--- final.c 1999/04/25 02:15:39
*************** dbr_sequence_length ()
*** 659,664 ****
--- 659,667 ----
static short *insn_lengths;
int *insn_addresses;
+ /* Max uid for which the above arrays are valid. */
+ static int insn_lengths_max_uid;
+
/* Address of insn being processed. Used by `insn_current_length'. */
int insn_current_address;
*************** init_insn_lengths ()
*** 705,710 ****
--- 708,714 ----
{
free (insn_lengths);
insn_lengths = 0;
+ insn_lengths_max_uid = 0;
}
if (insn_addresses)
{
*************** get_attr_length (insn)
*** 730,736 ****
int i;
int length = 0;
! if (insn_lengths)
return insn_lengths[INSN_UID (insn)];
else
switch (GET_CODE (insn))
--- 734,740 ----
int i;
int length = 0;
! if (insn_lengths_max_uid > INSN_UID (insn))
return insn_lengths[INSN_UID (insn)];
else
switch (GET_CODE (insn))
*************** shorten_branches (first)
*** 1160,1165 ****
--- 1164,1170 ----
/* Allocate the rest of the arrays. */
insn_lengths = (short *) xmalloc (max_uid * sizeof (short));
insn_addresses = (int *) xmalloc (max_uid * sizeof (int));
+ insn_lengths_max_uid = max_uid;
/* Syntax errors can lead to labels being outside of the main insn stream.
Initialize insn_addresses, so that we get reproducible results. */
bzero ((char *)insn_addresses, max_uid * sizeof *insn_addresses);