aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-10-13 09:32:29 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-10-13 09:32:29 +0000
commit90f2b7e220df8ce298b2cd8f853a02aaecdbff0b (patch)
treee6e6b7a6cd37b119b1118babd9d53aa30d191bde /gcc/final.c
parent610c45fcbfff43176beefefcea74c6137a432220 (diff)
downloadgcc-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/final.c')
-rw-r--r--gcc/final.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/gcc/final.c b/gcc/final.c
index eff2ee6..0ddf779 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -3199,14 +3199,7 @@ alter_subreg (rtx *xp, bool final_p)
/* For paradoxical subregs on big-endian machines, SUBREG_BYTE
contains 0 instead of the proper offset. See simplify_subreg. */
if (paradoxical_subreg_p (x))
- {
- int difference = GET_MODE_SIZE (GET_MODE (y))
- - GET_MODE_SIZE (GET_MODE (x));
- if (WORDS_BIG_ENDIAN)
- offset += (difference / UNITS_PER_WORD) * UNITS_PER_WORD;
- if (BYTES_BIG_ENDIAN)
- offset += difference % UNITS_PER_WORD;
- }
+ offset = byte_lowpart_offset (GET_MODE (x), GET_MODE (y));
if (final_p)
*xp = adjust_address (y, GET_MODE (x), offset);