final.c: (insn_lengths): Make it an int *, so that large jump tables don't overflow.
authorAlan Modra <amodra@bigpond.net.au>
Mon, 26 Nov 2001 00:46:40 +0000 (00:46 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Mon, 26 Nov 2001 00:46:40 +0000 (11:16 +1030)
* final.c: (insn_lengths): Make it an int *, so that large jump
tables don't overflow.

From-SVN: r47331

gcc/ChangeLog
gcc/final.c

index 231c5b5f70998e00ea7bc863cf9178f319d419f2..a3af9cc248b187dd29b57230e096a093c93f9006 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-26  Alan Modra  <amodra@bigpond.net.au>
+
+       * final.c: (insn_lengths): Make it an int *, so that large jump
+       tables don't overflow.
+
 2001-11-25  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * c-format.c (FMT_FLAG_DOLLAR_GAP_POINTER_OK): New.
index 761bd7142ad0efbf28d794b0c08702bfc145aefb..c7ad5e60a034109517fd965b168c903787f299b5 100644 (file)
@@ -603,7 +603,7 @@ dbr_sequence_length ()
 /* Arrays for insn lengths, and addresses.  The latter is referenced by
    `insn_current_length'.  */
 
-static short *insn_lengths;
+static int *insn_lengths;
 
 #ifdef HAVE_ATTR_length
 varray_type insn_addresses_;
@@ -1186,7 +1186,7 @@ shorten_branches (first)
 #ifdef HAVE_ATTR_length
 
   /* Allocate the rest of the arrays.  */
-  insn_lengths = (short *) xmalloc (max_uid * sizeof (short));
+  insn_lengths = (int *) xmalloc (max_uid * sizeof (*insn_lengths));
   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.  */