ira-color.c (SORTGT): New macro, helper for qsort callbacks.

* ira-color.c (SORTGT): New macro, helper for qsort callbacks.
        (allocno_priority_compare_func): Use it instead of a straight
        difference computation over priorities.

From-SVN: r163760
This commit is contained in:
Olivier Hainque 2010-09-02 07:22:33 +00:00
parent e10909ceaf
commit 71af27d2fb
2 changed files with 15 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2010-09-02 Olivier Hainque <hainque@adacore.com>
* ira-color.c (SORTGT): New macro, helper for qsort callbacks.
(allocno_priority_compare_func): Use it instead of a straight
difference computation over priorities.
2010-09-02 Andi Kleen <ak@linux.intel.com>
* opts.c (common_handle_option): Fix OPT_fwhopr/fwhopr_ handling.
@ -170,6 +176,7 @@
(scev_probably_wraps_p): Adjust.
* tree-ssa-loop.c (tree_ssa_loop_bounds): Likewise.
>>>>>>> .r163759
2010-09-01 Nick Clifton <nickc@redhat.com>
* config/stormy16/stormy16.c: Use REG_P, MEM_P and CONST_INT_P

View file

@ -83,6 +83,12 @@ static alloc_pool splay_tree_node_pool;
more costly although simpler. */
static VEC(ira_allocno_t,heap) *removed_splay_allocno_vec;
/* Helper for qsort comparison callbacks - return a positive integer if
X > Y, or a negative value otherwise. Use a conditional expression
instead of a difference computation to insulate from possible overflow
issues, e.g. X - Y < 0 for some X > 0 and Y < 0. */
#define SORTGT(x,y) (((x) > (y)) ? 1 : -1)
/* This page contains functions used to find conflicts using allocno
@ -1858,8 +1864,8 @@ allocno_priority_compare_func (const void *v1p, const void *v2p)
pri1 = allocno_priorities[ALLOCNO_NUM (a1)];
pri2 = allocno_priorities[ALLOCNO_NUM (a2)];
if (pri2 - pri1)
return pri2 - pri1;
if (pri2 != pri1)
return SORTGT (pri2, pri1);
/* If regs are equally good, sort by allocnos, so that the results of
qsort leave nothing to chance. */