Re: [PATCH] haifa-sched: fix autopref_rank_for_schedule comparator [PR109187]

2023-03-28 Thread Richard Biener via Gcc-patches
On Tue, Mar 28, 2023 at 3:11 PM Alexander Monakov via Gcc-patches wrote: > > Do not attempt to use a plain subtraction for generating a three-way > comparison result in autopref_rank_for_schedule qsort comparator, as > offsets are not restricted and subtraction may overflow. Open-code > a safe th

[PATCH] haifa-sched: fix autopref_rank_for_schedule comparator [PR109187]

2023-03-28 Thread Alexander Monakov via Gcc-patches
Do not attempt to use a plain subtraction for generating a three-way comparison result in autopref_rank_for_schedule qsort comparator, as offsets are not restricted and subtraction may overflow. Open-code a safe three-way comparison instead. gcc/ChangeLog: PR rtl-optimization/109187