diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2016-12-06 20:02:03 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2016-12-06 20:02:03 +0000 |
commit | 9a38b8b940299eeceb51652bc070834809bb126e (patch) | |
tree | 10275f75468cc6d0f1db8d23b43cb71ca65ff672 /gcc/lra-lives.c | |
parent | cd3fe55a185181aeb1a6b626cfbaa6e14839b7e9 (diff) | |
download | gcc-9a38b8b940299eeceb51652bc070834809bb126e.zip gcc-9a38b8b940299eeceb51652bc070834809bb126e.tar.gz gcc-9a38b8b940299eeceb51652bc070834809bb126e.tar.bz2 |
lra-lives.c (process_bb_lives): Update biggest mode for implicitly used hard reg.
2016-12-06 Vladimir Makarov <vmakarov@redhat.com>
target/77761
* lra-lives.c (process_bb_lives): Update biggest mode for
implicitly used hard reg.
2016-12-06 Vladimir Makarov <vmakarov@redhat.com>
target/77761
* testsuite/gcc.target/i386/pr77761.c: New.
From-SVN: r243316
Diffstat (limited to 'gcc/lra-lives.c')
-rw-r--r-- | gcc/lra-lives.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c index 5573ff8..3ffec90 100644 --- a/gcc/lra-lives.c +++ b/gcc/lra-lives.c @@ -702,11 +702,24 @@ process_bb_lives (basic_block bb, int &curr_point, bool dead_insn_p) /* Update max ref width and hard reg usage. */ for (reg = curr_id->regs; reg != NULL; reg = reg->next) { + int i, regno = reg->regno; + if (GET_MODE_SIZE (reg->biggest_mode) - > GET_MODE_SIZE (lra_reg_info[reg->regno].biggest_mode)) - lra_reg_info[reg->regno].biggest_mode = reg->biggest_mode; - if (reg->regno < FIRST_PSEUDO_REGISTER) - lra_hard_reg_usage[reg->regno] += freq; + > GET_MODE_SIZE (lra_reg_info[regno].biggest_mode)) + lra_reg_info[regno].biggest_mode = reg->biggest_mode; + if (regno < FIRST_PSEUDO_REGISTER) + { + lra_hard_reg_usage[regno] += freq; + /* A hard register explicitly can be used in small mode, + but implicitly it can be used in natural mode as a + part of multi-register group. Process this case + here. */ + for (i = 1; i < hard_regno_nregs[regno][reg->biggest_mode]; i++) + if (GET_MODE_SIZE (GET_MODE (regno_reg_rtx[regno + i])) + > GET_MODE_SIZE (lra_reg_info[regno + i].biggest_mode)) + lra_reg_info[regno + i].biggest_mode + = GET_MODE (regno_reg_rtx[regno + i]); + } } call_p = CALL_P (curr_insn); |