Undefined behavior and overflow

Deviations from Python Semantics — Numba 0.52.0.dev0+274.g626b40e-py3.7-linux-x86_64.egg documentation says “arithmetic operations can wrapround or produce undefined results or overflow”.

Undefined behavior is very different than wrapping around:

  • Wrapping around may be unexpected, but it’s consistent, so if it’s undesirable it can be debugged without too much trouble.
  • In contrast, undefined behavior means the compiler can simply assume the situation is impossible e.g. when doing optimization passes, which means a very wide range of potentially very surprising outcomes that can vary by compiler version and optimization options.

Is there some more detailed documentation of when Numba has undefined results vs when it has wrapping behavior?