@@ -760,6 +760,11 @@ int convert_to_jump(struct instruction *insn, struct basic_block *target)
struct basic_block *child;
int changed = REPEAT_CSE;
+ switch (insn->opcode) {
+ case OP_CBR:
+ changed |= remove_phisources(insn->bb, insn->bb_true == target ? insn->bb_false : insn->bb_true);
+ break;
+ }
kill_use(&insn->cond);
insn->bb_true = target;
insn->bb_false = NULL;
@@ -8,7 +8,6 @@ void foo(int a, int b)
/*
* check-name: bad-phisrc1
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-excludes: phi\\.
@@ -16,7 +16,6 @@ out:
/*
* check-name: bad-phisrc1a
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-contains: select\\.
When a parent is removed from a BB containing one or several phi-nodes, the corresponding phi-sources must be removed from the phi-node. However this is not done and consequentially: * it becomes impossibly to correctly reason about the flow of values through these phi-nodes. * simplifications are missed (e.g. if-conversion). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- flow.c | 5 +++++ validation/optim/bad-phisrc1.c | 1 - validation/optim/bad-phisrc1a.c | 1 - 3 files changed, 5 insertions(+), 2 deletions(-)