Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- simplify.c | 3 +++ validation/kill-phisrc.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 validation/kill-phisrc.c diff --git a/simplify.c b/simplify.c index 90e45bf1a..ced63bfa3 100644 --- a/simplify.c +++ b/simplify.c @@ -210,6 +210,9 @@ void kill_instruction(struct instruction *insn) case OP_PHI: clear_phi(insn); break; + case OP_PHISOURCE: + kill_use(&insn->phi_src); + break; case OP_SYMADDR: repeat_phase |= REPEAT_SYMBOL_CLEANUP; diff --git a/validation/kill-phisrc.c b/validation/kill-phisrc.c new file mode 100644 index 000000000..f00dbed24 --- /dev/null +++ b/validation/kill-phisrc.c @@ -0,0 +1,21 @@ +int foo(int a, int b) +{ + int r = a + b; + + if (a && 0) { + int s = r; + if (b) + s = 0; + (void) s; + } + + return 0; +} + +/* + * check-name: kill-phisrc + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-excludes: add\\. + */ -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html