* tree-ssa-operands.c (vop_free_bucket_size): Never return value
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jan 2007 21:58:18 +0000 (21:58 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Jan 2007 21:58:18 +0000 (21:58 +0000)
greater than NUM_VOP_FREE_BUCKETS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120933 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-operands.c

index 983e3d9..68fe465 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-18  Jan Hubicka  <jh@suse.cz>
+
+       * tree-ssa-operands.c (vop_free_bucket_size): Never return value
+       greater than NUM_VOP_FREE_BUCKETS.
+
 2007-01-18  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree-ssa-structalias.c: Update comments.
index 23e493a..0006de9 100644 (file)
@@ -305,15 +305,17 @@ vop_free_bucket_size (int bucket)
 static inline int 
 vop_free_bucket_index (int num)
 {
-  gcc_assert (num > 0);
+  gcc_assert (num > 0 && NUM_VOP_FREE_BUCKETS > 16);
 
   /* Sizes 1 through 16 use buckets 0-15.  */
   if (num <= 16)
     return num - 1;
-  /* Buckets 16 - 45  represent 17 through 256 in 8 unit chunks.  */
-  if (num < 256)
-    return 14 + (num - 1) / 8;
-  return -1;
+  /* Buckets 16 - NUM_VOP_FREE_BUCKETS represent 8 unit chunks.  */
+  num = 14 + (num - 1) / 8;
+  if (num >= NUM_VOP_FREE_BUCKETS)
+    return -1;
+  else
+    return num;
 }