While trying to implement loops in LLVM, the following testcase appears
to have some strange behavior:
int foo(int x)
{
int i;
for (i = 0; i < 10; i++)
x += 42;
return x;
}
when run through test-linearize produces
foo.c:1:5: warning: symbol 'foo' was not declared. Should it be static?
foo:
.L0x7f4c095ae010:
<entry-point>
phisrc.32 %phi2(x) <- %arg1
phisrc.32 %phi4(x) <- %arg1
phisrc.32 %phi7(i) <- $0
br .L0x7f4c095ae150
.L0x7f4c095ae150:
phi.32 %r1(i) <- %phi7(i), %phi8(i)
setlt.32 %r2 <- %r1(i), $10
br %r2, .L0x7f4c095ae060, .L0x7f4c095ae100
.L0x7f4c095ae060:
add.32 %r5 <- %r9, $42
phisrc.32 %phi3(x) <- %r5
phisrc.32 %phi5(x) <- %r5
add.32 %r8 <- %r1(i), $1
phisrc.32 %phi8(i) <- %r8
br .L0x7f4c095ae150
.L0x7f4c095ae100:
phi.32 %r9 <- %phi2(x), %phi3(x)
ret.32 %r9
So... WTF did %r9 come from, in the third basic block?
--
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