On Wed, Jun 1, 2016 at 8:37 AM, DNF <oyv...@gmail.com> wrote:
> Out of curiosity: My understanding has been that type instabilities are
> related to the compiler not being able to predict the types of variables
> based on input types, not variables simply (and predictably) changing types
> during program execution.

For this case, the variable is **NOT** predictably changing type
without knowing that the loop will run for at least once and FWIW it
can have different types in the loop.

The so-called `henchmen unrolling` (name invented by Stefan or Jeff)
can help with this to a certain degree by unrolling the first loop.

>
> Should the compiler ideally be able to catch the case we're seeing here, and
> predict that bar should be a float? Or is this case particularly hard for
> some reason?

Reply via email to