AT_inline flag remains
I was playing with a toy example (on the glob_array3 branch) and get the error in the title. Probably, the example makes no sense, but I was asked to report it, so here it is.
export fn main (reg u64 x) -> reg u64 {
stack u64[10] t;
reg u64 res;
inline int i;
inline int j;
for i = 0 to 10 {
t[i] = i;
res = 2 * i;
j =(int) res;
t[j] += x;
}
res = t[0];
return res;
}
(I was asked by Jasmin with a kind PLEASE REPORT)
Interestingly, on master the error is different: linearisation error assign not a word (but I am also asked to report it).
After discussing with Benjamin, the error is justified, but should be improved (the PLEASE REPORT should be removed).
Another example:
export fn main (reg u64 r) -> reg u64 {
reg u64 res;
reg bool b b2;
b = r == 0;
b2 = r == 1;
res = 0;
if (b && b2) {
res = 1;
}
return res;
}
fails with
"test_bool.jazz", line 5 (2-13):
internal compilation error:
AT_inline flag remains in instruction:
b = ZF; /* bool:i */
The inline instructions are introduced by lowering.
This example can not be compiled. b and b2 will receive the zf flag. So maybe we should not emit an "internal compilation error" and more a user error.
Interestingly, the first program now passes correctly on latest main. Maybe the pass propagate_inline_variable fixed the problem. The second program still produces the error, though.
Fixed by #313.