aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:17:29 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:17:29 +0000
commit59b5118623ad2e755fbb16b03f2ea122bceebdd2 (patch)
treed8a02d6a9315b50f067bce1643d4b753a588251f /gcc/rtlanal.c
parent5e4e37bff76a3fbaf4f6e18a343f7c484eeb642e (diff)
downloadgcc-59b5118623ad2e755fbb16b03f2ea122bceebdd2.zip
gcc-59b5118623ad2e755fbb16b03f2ea122bceebdd2.tar.gz
gcc-59b5118623ad2e755fbb16b03f2ea122bceebdd2.tar.bz2
[51/77] Use opt_scalar_int_mode when iterating over integer modes
This patch uses opt_scalar_int_mode rather than machine_mode when iterating over scalar_int_modes, in cases where that helps with future patches. (Using machine_mode is still OK in places that don't really care about the mode being a scalar integer.) 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * cse.c (cse_insn): Use opt_scalar_int_mode for the mode iterator. * explow.c (hard_function_value): Likewise. * expmed.c (extract_fixed_bit_field_1): Likewise. Move the convert_to_mode call outside the loop. * expr.c (alignment_for_piecewise_move): Use opt_scalar_int_mode for the mode iterator. Require the mode specified by max_pieces to exist. (emit_block_move_via_movmem): Use opt_scalar_int_mode for the mode iterator. (copy_blkmode_to_reg): Likewise. (set_storage_via_setmem): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * rtlanal.c (init_num_sign_bit_copies_in_rep): Likewise. * stor-layout.c (finish_bitfield_representative): Likewise. gcc/fortran/ * trans-types.c (gfc_init_kinds): Use opt_scalar_int_mode for the mode iterator. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251503
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 3066ae2..63009a2 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -5660,12 +5660,14 @@ get_condition (rtx_insn *jump, rtx_insn **earliest, int allow_cc_mode,
static void
init_num_sign_bit_copies_in_rep (void)
{
- machine_mode mode, in_mode;
+ opt_scalar_int_mode in_mode_iter;
+ scalar_int_mode mode;
- FOR_EACH_MODE_IN_CLASS (in_mode, MODE_INT)
- FOR_EACH_MODE_UNTIL (mode, in_mode)
+ FOR_EACH_MODE_IN_CLASS (in_mode_iter, MODE_INT)
+ FOR_EACH_MODE_UNTIL (mode, in_mode_iter.require ())
{
- machine_mode i;
+ scalar_int_mode in_mode = in_mode_iter.require ();
+ scalar_int_mode i;
/* Currently, it is assumed that TARGET_MODE_REP_EXTENDED
extends to the next widest mode. */
@@ -5678,7 +5680,7 @@ init_num_sign_bit_copies_in_rep (void)
{
/* This must always exist (for the last iteration it will be
IN_MODE). */
- machine_mode wider = GET_MODE_WIDER_MODE (i).require ();
+ scalar_int_mode wider = GET_MODE_WIDER_MODE (i).require ();
if (targetm.mode_rep_extended (i, wider) == SIGN_EXTEND
/* We can only check sign-bit copies starting from the