jasmin icon indicating copy to clipboard operation
jasmin copied to clipboard

Combination of flags passed as an argument triggers an internal error

Open eponier opened this issue 2 years ago • 3 comments

fn zero(reg bool b) -> reg u64 {
  reg u64 res tmp;
  res = 0;
  tmp = 1;
  res = tmp if b;
  return res;
}

export
fn main(reg u64 x) -> reg u64 {
  reg u64 result;
  reg bool b;
  ?{"<="=b} = #TEST(x, x);

  result = zero(b);
  return result;
}

triggers

line 15 (2-19):
internal compilation error in function main:
  stack allocation: get_Pvar: variable expected

b is turned as some point into some flag combination, while stack allocation expects just a single variable.

eponier avatar Mar 14 '23 17:03 eponier

Do we want to allow boolean arguments/return values to local functions?

vbgl avatar Mar 14 '23 19:03 vbgl

I think in some cases, this can be useful. At least, this is tested in the test-suite.

eponier avatar Mar 15 '23 10:03 eponier

But it does not seem to be used in libjade at the moment.

eponier avatar Mar 15 '23 10:03 eponier