https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109670
--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Thomas Neumann <tneum...@gcc.gnu.org>: https://gcc.gnu.org/g:7b21a74b41b30cd070f69523edf9583d1e287249 commit r13-7411-g7b21a74b41b30cd070f69523edf9583d1e287249 Author: Thomas Neumann <tneum...@users.sourceforge.net> Date: Wed May 10 12:33:49 2023 +0200 fix radix sort on 32bit platforms [PR109670] The radix sort uses two buffers, a1 for input and a2 for output. After every digit the role of the two buffers is swapped. When terminating the sort early the code made sure the output was in a2. However, when we run out of bits, as can happen on 32bit platforms, the sorted result was in a1, as we had just swapped a1 and a2. This patch fixes the problem by unconditionally having a1 as output after every loop iteration. This bug manifested itself only on 32bit platforms and even then only in some circumstances, as it needs frames where a swap is required due to differences in the top-most byte, which is affected by ASLR. The new logic was validated by exhaustive search over 32bit input values. libgcc/ChangeLog: PR libgcc/109670 * unwind-dw2-fde.c: Fix radix sort buffer management.