aboutsummaryrefslogtreecommitdiff
path: root/gcc/reginfo.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-03 07:17:33 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-03 07:17:33 +0000
commitfad2288b4b1e63fce8550d70f99bcc16e54bf539 (patch)
treedd8b4417c22587406a00bbac5e052db18aa2d169 /gcc/reginfo.c
parent07626e49a0ad431f8e69fcc472400780f3d98044 (diff)
downloadgcc-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/reginfo.c')
-rw-r--r--gcc/reginfo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/reginfo.c b/gcc/reginfo.c
index 3d1c2ed..90d25c8 100644
--- a/gcc/reginfo.c
+++ b/gcc/reginfo.c
@@ -1294,10 +1294,14 @@ record_subregs_of_mode (rtx subreg, bool partial_def)
subregs will be invalid.
This relies on the fact that we've already been passed
- SUBREG with PARTIAL_DEF set to false. */
- unsigned int size = MAX (REGMODE_NATURAL_SIZE (shape.inner_mode),
- GET_MODE_SIZE (shape.outer_mode));
- gcc_checking_assert (size < GET_MODE_SIZE (shape.inner_mode));
+ SUBREG with PARTIAL_DEF set to false.
+
+ The size of the outer mode must ordered wrt the size of the
+ inner mode's registers, since otherwise we wouldn't know at
+ compile time how many registers the outer mode occupies. */
+ poly_uint64 size = MAX (REGMODE_NATURAL_SIZE (shape.inner_mode),
+ GET_MODE_SIZE (shape.outer_mode));
+ gcc_checking_assert (known_lt (size, GET_MODE_SIZE (shape.inner_mode)));
if (known_ge (shape.offset, size))
shape.offset -= size;
else