From f0a404561c4abc2fcb6015cc96ca779b8eecc411 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Thu, 20 Jul 2017 18:15:55 +0300 Subject: [PATCH] lra-assigns.c: fix pseudo_compare_func * lra-assigns.c (pseudo_compare_func): Fix comparison step based on non_spilled_static_chain_regno_p. From-SVN: r250395 --- gcc/ChangeLog | 5 +++++ gcc/lra-assigns.c | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9eb61fe62de..cb7e697d69b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-07-20 Alexander Monakov + + * lra-assigns.c (pseudo_compare_func): Fix comparison step based on + non_spilled_static_chain_regno_p. + 2017-07-20 Alexander Monakov * gimple-ssa-store-merging.c (sort_by_bitpos): Return 0 on equal bitpos. diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c index 42556d3a65e..2aadeefb214 100644 --- a/gcc/lra-assigns.c +++ b/gcc/lra-assigns.c @@ -253,10 +253,9 @@ pseudo_compare_func (const void *v1p, const void *v2p) /* Assign hard reg to static chain pointer first pseudo when non-local goto is used. */ - if (non_spilled_static_chain_regno_p (r1)) - return -1; - else if (non_spilled_static_chain_regno_p (r2)) - return 1; + if ((diff = (non_spilled_static_chain_regno_p (r2) + - non_spilled_static_chain_regno_p (r1))) != 0) + return diff; /* Prefer to assign more frequently used registers first. */ if ((diff = lra_reg_info[r2].freq - lra_reg_info[r1].freq) != 0) -- 2.30.2