diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-10-13 09:32:29 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-10-13 09:32:29 +0000 |
commit | 90f2b7e220df8ce298b2cd8f853a02aaecdbff0b (patch) | |
tree | e6e6b7a6cd37b119b1118babd9d53aa30d191bde /gcc/combine.c | |
parent | 610c45fcbfff43176beefefcea74c6137a432220 (diff) | |
download | gcc-90f2b7e220df8ce298b2cd8f853a02aaecdbff0b.zip gcc-90f2b7e220df8ce298b2cd8f853a02aaecdbff0b.tar.gz gcc-90f2b7e220df8ce298b2cd8f853a02aaecdbff0b.tar.bz2 |
Make more use of byte_lowpart_offset
This patch uses byte_lowpart_offset in places that open-coded the
calculation.
2017-10-13 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* caller-save.c (replace_reg_with_saved_mem): Use byte_lowpart_offset.
* combine.c (gen_lowpart_for_combine): Likewise.
* dwarf2out.c (rtl_for_decl_location): Likewise.
* final.c (alter_subreg): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
(gen_lowpart_if_possible): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r253714
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index b89ee6d..4d2f79b 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -11618,8 +11618,6 @@ gen_lowpart_for_combine (machine_mode omode, rtx x) if (MEM_P (x)) { - int offset = 0; - /* Refuse to work on a volatile memory ref or one with a mode-dependent address. */ if (MEM_VOLATILE_P (x) @@ -11632,14 +11630,7 @@ gen_lowpart_for_combine (machine_mode omode, rtx x) if (paradoxical_subreg_p (omode, imode)) return gen_rtx_SUBREG (omode, x, 0); - if (WORDS_BIG_ENDIAN) - offset = MAX (isize, UNITS_PER_WORD) - MAX (osize, UNITS_PER_WORD); - - /* Adjust the address so that the address-after-the-data is - unchanged. */ - if (BYTES_BIG_ENDIAN) - offset -= MIN (UNITS_PER_WORD, osize) - MIN (UNITS_PER_WORD, isize); - + HOST_WIDE_INT offset = byte_lowpart_offset (omode, imode); return adjust_address_nv (x, omode, offset); } |