https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115599

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>:

https://gcc.gnu.org/g:ae13af26060eb686418ea9c9d455cd665049402d

commit r15-1577-gae13af26060eb686418ea9c9d455cd665049402d
Author: Richard Biener <rguent...@suse.de>
Date:   Sun Jun 23 14:37:53 2024 +0200

    tree-optimization/115599 - reassoc qsort comparator issue

    The compare_repeat_factors comparator fails qsort checking eventually
    because it uses rf2->rank - rf1->rank to compare unsigned numbers
    which causes issues for ranks that interpret negative as signed.

    Fixed by re-writing the obvious way.  I've also fixed the count
    comparison which suffers from truncation as count is 64bit signed
    while the comparator result is 32bit int (that's a lot less likely
    to hit in practice though).

    The testcase from the PR is too large to include.

            PR tree-optimization/115599
            * tree-ssa-reassoc.cc (compare_repeat_factors): Use explicit
            compares to avoid truncations.

Reply via email to