jasmin icon indicating copy to clipboard operation
jasmin copied to clipboard

Register allocation and ?{} syntax

Open sarranz opened this issue 2 years ago • 2 comments

This program

export
fn main(reg u64 x) -> reg u64 {
    reg bool lt;

    ?{ "<u" = lt } = #CMP(x, 10);

    while (lt) {
        x += 2;
        ?{ "<u" = lt } = #CMP(x, 10);
    }

    x = x;
    return x;
}

gives compilation error: register allocation: variables { lt.238; lt.226 } remain unallocated, but if we change one (or both) of the ?{ } operators by _, lt, _, _, _ then it compiles correctly.

sarranz avatar Oct 13 '23 17:10 sarranz

Did you try to replace "reg bool lt" by "inline bool lt" ?

bgregoir avatar Oct 13 '23 18:10 bgregoir

No, because it triggers #478.

sarranz avatar Oct 13 '23 20:10 sarranz