aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-xtensa.c
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@acm.org>2005-06-07 18:31:34 +0000
committerBob Wilson <bob.wilson@acm.org>2005-06-07 18:31:34 +0000
commit0bf60745767d2465c81ee57ae7705a62d6d8fafe (patch)
tree8257f05b6cf7a003f9a861fa27f46ffdea76b339 /gas/config/tc-xtensa.c
parent05ab1f3b1c6eb9377b0ea51ded17c95e59fb25dc (diff)
downloadgdb-0bf60745767d2465c81ee57ae7705a62d6d8fafe.zip
gdb-0bf60745767d2465c81ee57ae7705a62d6d8fafe.tar.gz
gdb-0bf60745767d2465c81ee57ae7705a62d6d8fafe.tar.bz2
* 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.
Diffstat (limited to 'gas/config/tc-xtensa.c')
-rw-r--r--gas/config/tc-xtensa.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 535a19d..a93f57e 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -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);
}
}