diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-03 07:17:33 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-03 07:17:33 +0000 |
commit | fad2288b4b1e63fce8550d70f99bcc16e54bf539 (patch) | |
tree | dd8b4417c22587406a00bbac5e052db18aa2d169 /gcc/rtlanal.c | |
parent | 07626e49a0ad431f8e69fcc472400780f3d98044 (diff) | |
download | gcc-fad2288b4b1e63fce8550d70f99bcc16e54bf539.zip gcc-fad2288b4b1e63fce8550d70f99bcc16e54bf539.tar.gz gcc-fad2288b4b1e63fce8550d70f99bcc16e54bf539.tar.bz2 |
poly_int: REGMODE_NATURAL_SIZE
This patch makes target-independent code that uses REGMODE_NATURAL_SIZE
treat it as a poly_int rather than a constant.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* combine.c (can_change_dest_mode): Handle polynomial
REGMODE_NATURAL_SIZE.
* expmed.c (store_bit_field_1): Likewise.
* expr.c (store_constructor): Likewise.
* emit-rtl.c (validate_subreg): Operate on polynomial mode sizes
and polynomial REGMODE_NATURAL_SIZE.
(gen_lowpart_common): Likewise.
* reginfo.c (record_subregs_of_mode): Likewise.
* rtlanal.c (read_modify_subreg_p): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256149
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index e75ff10..78836ed 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1395,13 +1395,15 @@ modified_in_p (const_rtx x, const_rtx insn) bool read_modify_subreg_p (const_rtx x) { - unsigned int isize, osize; if (GET_CODE (x) != SUBREG) return false; - isize = GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))); - osize = GET_MODE_SIZE (GET_MODE (x)); - return isize > osize - && isize > REGMODE_NATURAL_SIZE (GET_MODE (SUBREG_REG (x))); + poly_uint64 isize = GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))); + poly_uint64 osize = GET_MODE_SIZE (GET_MODE (x)); + poly_uint64 regsize = REGMODE_NATURAL_SIZE (GET_MODE (SUBREG_REG (x))); + /* The inner and outer modes of a subreg must be ordered, so that we + can tell whether they're paradoxical or partial. */ + gcc_checking_assert (ordered_p (isize, osize)); + return (maybe_gt (isize, osize) && maybe_gt (isize, regsize)); } /* Helper function for set_of. */ |