mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-26 08:11:21 +02:00
As reported in issue #596, the edx register isn't marked as clobbered in div64_32(), which could technically allow gcc to try to reuse it if it needed a copy of the 32 highest bits of the o1 register after the operation. Two attempts were tried, one using a dummy 32-bit local variable to store the intermediary edx and another one switching to "=A" and making result a long long. It turns out the former makes the resulting object code significantly dirtier while the latter makes it better and was kept. This is due to gcc's difficulties at working with register pairs mixing 32- and 64- bit values on i386. It was verified that no code change happened at all on x86_64, armv7, aarch64 nor mips32. In practice it's only used by the frequency counters so this bug cannot even be triggered but better fix it. This may be backported to stable branches though it will not fix any issue.