Subject: bug#21513:

From: Martin Liška <[email-masked]>
Date: Sat, 18 Jan 2020 15:44:20 +0100

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