I can confirm that it never finishes on i586. I would recommend to replace DEBUG_ASSERT (num >= 0); which expands to: ((num >= 0) ? (void) 0 : __builtin_unreachable ());
into:
if (num < 0)
__builtin_abort ();
From GCC documentation:
If control flow reaches the point of the __builtin_unreachable,
the program is undefined.
In this case it loops forever.
Martin
