diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-09-05 19:56:49 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-09-05 19:56:49 +0000 |
commit | 636bfdfaa1b466c5699e8e3c5d46a4f94c9b845c (patch) | |
tree | 1a7d54a04b7f2cd42c7cb4241e97d557d5123117 /gcc/lower-subreg.c | |
parent | 36560e9e15a83b068d3a9dd12816a2529086e69a (diff) |
Make more use of int_mode_for_mode
This patch converts more places that could use int_mode_for_mode
instead of mode_for_size. This is in preparation for an upcoming
patch that makes mode_for_size itself return an opt_mode.
The reason for using required () in exp2_immediate_p is that
we go on to do:
trunc_int_for_mode (..., int_mode)
which would be invalid for (and have failed for) BLKmode.
The reason for using required () in spu_convert_move and
resolve_simple_move is that we go on to use registers of
the returned mode in non-call rtl instructions, which would
be invalid for BLKmode.
2017-09-05 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* config/spu/spu.c (exp2_immediate_p): Use int_mode_for_mode.
(spu_convert_move): Likewise.
* lower-subreg.c (resolve_simple_move): Likewise.
From-SVN: r251725
Diffstat (limited to 'gcc/lower-subreg.c')
-rw-r--r-- | gcc/lower-subreg.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c index e93dbd66e1f..43b6cd0f650 100644 --- a/gcc/lower-subreg.c +++ b/gcc/lower-subreg.c @@ -956,11 +956,7 @@ resolve_simple_move (rtx set, rtx_insn *insn) if (real_dest == NULL_RTX) real_dest = dest; if (!SCALAR_INT_MODE_P (dest_mode)) - { - dest_mode = mode_for_size (GET_MODE_SIZE (dest_mode) * BITS_PER_UNIT, - MODE_INT, 0); - gcc_assert (dest_mode != BLKmode); - } + dest_mode = int_mode_for_mode (dest_mode).require (); dest = gen_reg_rtx (dest_mode); if (REG_P (real_dest)) REG_ATTRS (dest) = REG_ATTRS (real_dest); |