aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-10 13:38:35 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:55 -0700
commitb44ebb0676e55ae46c4dbb70a44d961c0c2c8901 (patch)
tree75acdf003c070638c8d78282ef869113eed6ce17 /example.c
parentOutput unimplemented instructions as such, rather (diff)
downloadsparse-b44ebb0676e55ae46c4dbb70a44d961c0c2c8901.tar.gz
sparse-b44ebb0676e55ae46c4dbb70a44d961c0c2c8901.tar.bz2
sparse-b44ebb0676e55ae46c4dbb70a44d961c0c2c8901.zip
Be a bit more forgiving about impossible output register situations.
We get those when encountering unimplemented instructions, since then we'll have bad register contents. Let's just silently ignore it for now.
Diffstat (limited to 'example.c')
-rw-r--r--example.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/example.c b/example.c
index ae5ceb1..74c33bf 100644
--- a/example.c
+++ b/example.c
@@ -799,7 +799,8 @@ static int final_pseudo_flush(struct bb_state *state, pseudo_t pseudo, struct ha
* storage for it..
*/
hash = find_storage_hash(pseudo, state->outputs);
- assert(hash);
+ if (!hash)
+ return 1;
out = hash->storage;
/* If the output is in a register, try to get it there.. */
@@ -837,6 +838,8 @@ static int final_pseudo_flush(struct bb_state *state, pseudo_t pseudo, struct ha
return 1;
copy_to_dst:
+ if (reg == dst)
+ return 1;
output_insn(state, "movl %s,%s", reg->name, dst->name);
add_pseudo_reg(state, pseudo, dst);
return 1;