From e10326ff910ab337741d0781a536435d51c5f044 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sun, 22 Oct 2017 21:07:50 +0000 Subject: Make more use of subreg_size_lowpart_offset This patch uses subreg_size_lowpart_offset in places that open-coded the calculation. The reload use (and the LRA one that was based on it) seemed to ignore the BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN case; it's not obvious whether that was deliberate or an oversight. 2017-10-22 Richard Sandiford Alan Hayward David Sherwood gcc/ * lra-spills.c (assign_mem_slot): Use subreg_size_lowpart_offset. * regcprop.c (maybe_mode_change): Likewise. * reload1.c (alter_reg): Likewise. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r253989 --- gcc/lra-spills.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gcc/lra-spills.c') diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c index ab33dd42412..5997b1e48f5 100644 --- a/gcc/lra-spills.c +++ b/gcc/lra-spills.c @@ -153,9 +153,7 @@ assign_mem_slot (int i) /* On a big endian machine, the "address" of the slot is the address of the low part that fits its inherent mode. */ - if (BYTES_BIG_ENDIAN && inherent_size < total_size) - adjust += (total_size - inherent_size); - + adjust += subreg_size_lowpart_offset (inherent_size, total_size); x = adjust_address_nv (x, GET_MODE (regno_reg_rtx[i]), adjust); /* Set all of the memory attributes as appropriate for a spill. */ -- cgit v1.2.3