From: Michael Beck Date: Wed, 7 Feb 2007 17:04:17 +0000 (+0000) Subject: Phi example X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=86c04f829c33228586f9fc1f04740bfeb8c0ef87;p=libfirm Phi example --- diff --git a/ir/be/test/phi_bad.c b/ir/be/test/phi_bad.c new file mode 100644 index 000000000..680acfcf4 --- /dev/null +++ b/ir/be/test/phi_bad.c @@ -0,0 +1,20 @@ +static int A; + +/* This function produces unnecessary Phi nodes due to the way + * x is assigned. Note: This is not a bug, its by the Phi construction algorithm. */ +void test(int l, int m) { + int i, x = m; + + for (i = 0; i < l; ++i) { + A = x; + + if (l > 5) + x = m; + } +} + +int main() +{ + test(4,5); + printf("A = %d\n", A); +}