jasmin-lang/jasmin

Fatal error in Stack Allocation

Opened this issue · 1 comments

This program

export
fn f () -> reg u64 {
  stack u64 s1;
  reg u64 res;

  res = s1;

  return res;
}

gives

Fatal error: exception File "src/intervalGraphColoring.ml", line 43, characters 6-12: Assertion failed

This is compiler/tests/fail/stack_allocation/x86-64/uninit_stack.jazz. I don't think this is the failure we want, and furthermore, I don't think we should be testing this kind of program with no semantics, lest we revive the nosemantics test directory discussion :)

An interesting, if irrelevant, remark, is that

export
fn f () -> reg u64 {
  stack u64 s1;
  reg u64 res;

  res = 0;
  res = s1;
  return res;
}

exhibits the same behavior, but

export
fn f () -> reg u64 {
  stack u64 s1;
  reg u64 res;

  res = #MOV(0);
  res = s1;
  return res;
}

compiles just fine.