aboutsummaryrefslogtreecommitdiff
path: root/flow.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-27 13:25:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:07 -0700
commit602f6b6c0d411876778852995e8131760016294e (patch)
tree69d6cb76b5ab7a3daf0e62c5c3879f0a833b6b07 /flow.c
parentWe had a big comment about destroying the use chains. So fix it already. (diff)
downloadsparse-602f6b6c0d411876778852995e8131760016294e.tar.gz
sparse-602f6b6c0d411876778852995e8131760016294e.tar.bz2
sparse-602f6b6c0d411876778852995e8131760016294e.zip
Leave symbol pseudo usage intact when doing phi-node conversion.
There's actually a reason we leave a bogus usage list for symbol pseudo's: they are special, and they traverse the list _while_ doing cleanup, and changing the list while they are traversing it is a bad idea. Also, symbol pseudos have special usage rules, and know "where" the usage is in an instruction, so they can (and do) check when their usage has changed.
Diffstat (limited to 'flow.c')
-rw-r--r--flow.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/flow.c b/flow.c
index 8b5cc7f..f61a364 100644
--- a/flow.c
+++ b/flow.c
@@ -291,7 +291,9 @@ void rewrite_load_instruction(struct instruction *insn, struct pseudo_list *domi
return;
complex_phi:
- kill_use(&insn->src);
+ /* We leave symbol pseudos with a bogus usage list here */
+ if (insn->src->type != PSEUDO_SYM)
+ kill_use(&insn->src);
insn->opcode = OP_PHI;
insn->phi_list = dominators;
}