diff options
author | Alexander Monakov <amonakov@ispras.ru> | 2017-10-19 19:48:34 +0300 |
---|---|---|
committer | Alexander Monakov <amonakov@gcc.gnu.org> | 2017-10-19 19:48:34 +0300 |
commit | 158ec0181de2bb07560388d6a6d015309f09ca11 (patch) | |
tree | be4c8ed23e23a63a0e4ace88e12961c61f0cbb15 | |
parent | 8fb0214b6620aef3d6a36e88c9d194026c61e3ef (diff) | |
download | gcc-158ec0181de2bb07560388d6a6d015309f09ca11.zip gcc-158ec0181de2bb07560388d6a6d015309f09ca11.tar.gz gcc-158ec0181de2bb07560388d6a6d015309f09ca11.tar.bz2 |
ira-color: fix allocno_priority_compare_func for qsort (PR 82395)
PR rtl-optimization/82395
* ira-color.c (allocno_priority_compare_func): Fix comparison step
based on non_spilled_static_chain_regno_p.
From-SVN: r253904
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ira-color.c | 9 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9a35b2c..c37cddb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-10-19 Alexander Monakov <amonakov@ispras.ru> + + PR rtl-optimization/82395 + * ira-color.c (allocno_priority_compare_func): Fix comparison step + based on non_spilled_static_chain_regno_p. + 2017-10-19 Uros Bizjak <ubizjak@gmail.com> * config/i386/i386.c (output_387_binary_op): Rewrite SSE part. diff --git a/gcc/ira-color.c b/gcc/ira-color.c index 22fdb88..31a4a80 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -3005,14 +3005,13 @@ allocno_priority_compare_func (const void *v1p, const void *v2p) { ira_allocno_t a1 = *(const ira_allocno_t *) v1p; ira_allocno_t a2 = *(const ira_allocno_t *) v2p; - int pri1, pri2; + int pri1, pri2, diff; /* Assign hard reg to static chain pointer pseudo first when non-local goto is used. */ - if (non_spilled_static_chain_regno_p (ALLOCNO_REGNO (a1))) - return 1; - else if (non_spilled_static_chain_regno_p (ALLOCNO_REGNO (a2))) - return -1; + if ((diff = (non_spilled_static_chain_regno_p (ALLOCNO_REGNO (a2)) + - non_spilled_static_chain_regno_p (ALLOCNO_REGNO (a1)))) != 0) + return diff; pri1 = allocno_priorities[ALLOCNO_NUM (a1)]; pri2 = allocno_priorities[ALLOCNO_NUM (a2)]; if (pri2 != pri1) |