New Issue: '--baseline'/'--no-inline-iterators' sends method iterators on unbounded ranges into an infinite loop

20041, "bradcray", "'--baseline'/'--no-inline-iterators' sends method iterators on unbounded ranges into an infinite loop", "2022-06-17T19:47:51Z"

Summary of Problem

When calling an iterator on an unbounded range with --no-inline-iterators, which is a part of --baseline, the compiler sends the generated code into an infinite loop because it assumes that any iterator over an unbounded range is itself infinite. This is no longer a safe assuption now that we're having unbounded ranges over bools and enums simply span the values in question. But it wasn't even before that since someone could define an obviously finite iterator on such ranges like:

iter range.foo() {
  yield 1;
}

Steps to Reproduce

Associated Future Test(s):
test/functions/iterators/bugs/no-inline-method-iter.chpl #20038

Configuration Information

  • Output of chpl --version: chpl version 1.27.0 pre-release (446195541f)