jasmin icon indicating copy to clipboard operation
jasmin copied to clipboard

Internal error for addresses with MMX variables

Open sarranz opened this issue 1 year ago • 2 comments

This program

export
fn main() -> reg u64 {
    reg u64 x;
    x = 0x1000;
    #mmx reg u64 y;
    y = x;
    [y] = 0;
    return x;
}

fails, which is expected, but with an internal error: internal compilation error in function main: asmgen: Invalid register name : MM0. I think it should be a user error. Same happens for reg ptr.

sarranz avatar Nov 20 '23 13:11 sarranz

Thanks for the report. In this case, I think that register allocation should fail. Is that right?

vbgl avatar Nov 20 '23 13:11 vbgl

I'm not sure who's supposed to report the error here, for this case I would be ok with changing the error at assembly generation. But it's true that in general maybe it's better add constraints to the register allocation graph, restricting which registers can be allocated to variables of addresses.

sarranz avatar Nov 20 '23 13:11 sarranz