The open-source static analysis platform Frama-C has a slicing plug-in with impact analysis functionality.
The OP suggests an example where the impact of the initialization sum = 0;
is being computed. The example is like this:
void main() {
int i = 1; int sum = 0;
while (i<11) {
sum = add(sum, i);
i = add(i, 1);
}
printf("sum = %d\n", sum);
printf("i = %d\n", i);
}
static int add(int a, int b)
{
return(a+b);
}
The command-line to use is:
frama-c-gui -val t.c

The check-mark in the left-hand side column tells the user that there are selected statements in function add
, too. In the bottom right corner, the analyzer points out a few minor issues with this example from an academic article.