diff options
author | Edward O'Callaghan <eocallaghan@alterapraxis.com> | 2014-02-20 20:06:42 +1100 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-03-08 15:48:13 +0100 |
commit | 2cf9715c9a766234ccf8a514bdf23af72c90b507 (patch) | |
tree | aa8f6bb9a85d97afa0ebd87d157b34ebbd25ad3c /util/romcc/romcc.c | |
parent | 946923b0fbeba89e56f78e8266cf7f623ee78a87 (diff) |
utils/romcc.c: Fix spurious unsigned integer comparisons.
Clang warns about comparisons of unsigned integers with being below
zero. Remove spurious logic checks that are always false.
Change-Id: I70c4d5331df81e48bf7ef27ff98400c4218f7edc
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-on: http://review.coreboot.org/5275
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Diffstat (limited to 'util/romcc/romcc.c')
-rw-r--r-- | util/romcc/romcc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c index b045b468e4..fb6a5e1c1f 100644 --- a/util/romcc/romcc.c +++ b/util/romcc/romcc.c @@ -2870,7 +2870,7 @@ static struct triple *do_farg(struct compile_state *state, unsigned i; ftype = func->type; - if((index < 0) || (index >= (ftype->elements + 2))) { + if(index >= (ftype->elements + 2)) { internal_error(state, func, "bad argument index: %d", index); } first = RHS(func, 0); @@ -18328,7 +18328,7 @@ static void print_interference_block( } /* Do a bunch of sanity checks */ valid_ins(state, ptr); - if ((ptr->id < 0) || (ptr->id > rstate->defs)) { + if (ptr->id > rstate->defs) { internal_error(state, ptr, "Invalid triple id: %d", ptr->id); } @@ -18943,7 +18943,7 @@ static void graph_ins( */ for(entry = live; entry; entry = entry->next) { struct live_range *lr; - if ((entry->member->id < 0) || (entry->member->id > rstate->defs)) { + if (entry->member->id > rstate->defs) { internal_error(state, 0, "bad entry?"); } lr = rstate->lrd[entry->member->id].lr; @@ -19915,7 +19915,7 @@ static void verify_colors(struct compile_state *state, struct reg_state *rstate) ins = first; do { if (triple_is_def(state, ins)) { - if ((ins->id < 0) || (ins->id > rstate->defs)) { + if (ins->id > rstate->defs) { internal_error(state, ins, "triple without a live range def"); } @@ -19950,7 +19950,7 @@ static void color_triples(struct compile_state *state, struct reg_state *rstate) first = state->first; ins = first; do { - if ((ins->id < 0) || (ins->id > rstate->defs)) { + if (ins->id > rstate->defs) { internal_error(state, ins, "triple without a live range"); } |