Commit 35ca4186 authored by Matthias Braun's avatar Matthias Braun
Browse files

assert that we are not exchanging kept PhiM nodes

parent f0f33267
......@@ -34,6 +34,17 @@ void exchange(ir_node *old, ir_node *nw)
ir_graph *irg = get_irn_irg(old);
assert(irg == get_irn_irg(nw));
#ifndef NDEBUG
/* When replacing a PhiM node, it must not be hold by a keep-alive edge.
* => Keep-alive edges are not normal users and should not move along when
* exchanging. */
if (is_Phi(old) && get_irn_mode(old) == mode_M && !is_Bad(nw)) {
ir_node *end = get_irg_end(irg);
foreach_irn_in(end, i, kept) {
assert(kept != old);
hook_replace(old, nw);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment