On 2024-09-25 13:48, Pádraig Brady wrote: > > Note factor does give the correct result on amd64 at least > without the asserts: Yes, as far as I know the existing code works correctly on all practical platforms. It's only pedantic/checking platforms, where shifts by negative or by too-large result in crashes or diagnostics, where the existing code fails. The bug is easy to fix and the fixdoesn't hurt performance significantly, so I installed the attached. Closing the bug report. While looking into this I got seduced by the prospect of making 'factor' a bit better (e.g., eliminate some recursion and fix some buffering issues) and installed a bunch of followup patches for 'factor'. Yeah, yeah, I should know better....