* config/tc-xtensa.h (resource_table): Change units to unsigned chars.
authorBob Wilson <bob.wilson@acm.org>
Tue, 7 Jun 2005 18:31:34 +0000 (18:31 +0000)
committerBob Wilson <bob.wilson@acm.org>
Tue, 7 Jun 2005 18:31:34 +0000 (18:31 +0000)
        * config/tc-xtensa.c (new_resource_table): Likewise.
        (resize_resource_table): Likewise.
        (release_resources): Fix assertion for unsigned values.

gas/ChangeLog
gas/config/tc-xtensa.c
gas/config/tc-xtensa.h

index 88f641ee7c61f3e0e9bd0b5489130a42c8c3bc5e..0593f7c1d9239a4b16ed6126eead67952b466ff4 100644 (file)
@@ -1,3 +1,10 @@
+2005-06-07  Bob Wilson  <bob.wilson@acm.org>
+
+       * config/tc-xtensa.h (resource_table): Change units to unsigned chars.
+       * config/tc-xtensa.c (new_resource_table): Likewise.
+       (resize_resource_table): Likewise.
+       (release_resources): Fix assertion for unsigned values.
+
 2005-06-07  Zack Weinberg  <zack@codesourcery.com>
 
        * cgen.c, cgen.h, tc.h, write.c, config/obj-coff.c
index 535a19d7fa868a84b98a8cae15a2bc0f9ea80fc7..a93f57eaf8e69f406c2c48cfd0c4a547f4d5a62e 100644 (file)
@@ -5788,9 +5788,9 @@ new_resource_table (void *data,
   rt->opcode_unit_use = ouuf;
   rt->opcode_unit_stage = ousf;
 
-  rt->units = (char **) xcalloc (cycles, sizeof (char *));
+  rt->units = (unsigned char **) xcalloc (cycles, sizeof (unsigned char *));
   for (i = 0; i < cycles; i++)
-    rt->units[i] = (char *) xcalloc (nu, sizeof (char));
+    rt->units[i] = (unsigned char *) xcalloc (nu, sizeof (unsigned char));
 
   return rt;
 }
@@ -5820,11 +5820,13 @@ resize_resource_table (resource_table *rt, int cycles)
   old_cycles = rt->allocated_cycles;
   rt->allocated_cycles = cycles;
 
-  rt->units = xrealloc (rt->units, sizeof (char *) * rt->allocated_cycles);
+  rt->units = xrealloc (rt->units,
+                       rt->allocated_cycles * sizeof (unsigned char *));
   for (i = 0; i < old_cycles; i++)
-    rt->units[i] = xrealloc (rt->units[i], sizeof (char) * rt->num_units);
+    rt->units[i] = xrealloc (rt->units[i],
+                            rt->num_units * sizeof (unsigned char));
   for (i = old_cycles; i < cycles; i++)
-    rt->units[i] = xcalloc (rt->num_units, sizeof (char));
+    rt->units[i] = xcalloc (rt->num_units, sizeof (unsigned char));
 }
 
 
@@ -5876,8 +5878,8 @@ release_resources (resource_table *rt, xtensa_opcode opcode, int cycle)
     {
       xtensa_funcUnit unit = (rt->opcode_unit_use) (rt->data, opcode, i);
       int stage = (rt->opcode_unit_stage) (rt->data, opcode, i);
+      assert (rt->units[stage + cycle][unit] > 0);
       rt->units[stage + cycle][unit]--;
-      assert (rt->units[stage + cycle][unit] >= 0);
     }
 }
 
index 99ff19a50c2e8049ae024c68ff7f3e1231bccc43..56c38f9984e22401c3534032248c791e20baa23e 100644 (file)
@@ -418,7 +418,7 @@ typedef struct
   opcode_num_units_func opcode_num_units;
   opcode_funcUnit_use_unit_func opcode_unit_use;
   opcode_funcUnit_use_stage_func opcode_unit_stage;
-  char **units;
+  unsigned char **units;
 } resource_table;
 
 resource_table *new_resource_table
This page took 0.035098 seconds and 4 git commands to generate.