I have two small tweaks to suggest. We should print the value only
once (or else we might get a lot of output for an expression that
lives in a loop) and we should make the value easy to recognize in
case the program prints other stuff. So perhaps:
{ int tmp1 = expr1;
static int _creduce_printed = 0;
if (!_creduce_printed) {
printf("creduce_value(%d)\n", tmp1);
_creduce_printed = 1;
}
x = foo(tmp1, expr2);}
Also we'll have to add a prototype for printf() to the compilation
unit or maybe it's better to simply include stdio.h.