aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.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/cse.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/cse.c')
-rw-r--r--gcc/cse.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index d8d730b..34ea3d2 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4885,11 +4885,12 @@ cse_insn (rtx_insn *insn)
&& GET_CODE (src) == AND && CONST_INT_P (XEXP (src, 1))
&& GET_MODE_SIZE (int_mode) < UNITS_PER_WORD)
{
- machine_mode tmode;
+ opt_scalar_int_mode tmode_iter;
rtx new_and = gen_rtx_AND (VOIDmode, NULL_RTX, XEXP (src, 1));
- FOR_EACH_WIDER_MODE (tmode, int_mode)
+ FOR_EACH_WIDER_MODE (tmode_iter, int_mode)
{
+ scalar_int_mode tmode = tmode_iter.require ();
if (GET_MODE_SIZE (tmode) > UNITS_PER_WORD)
break;
@@ -4932,7 +4933,6 @@ cse_insn (rtx_insn *insn)
{
struct rtx_def memory_extend_buf;
rtx memory_extend_rtx = &memory_extend_buf;
- machine_mode tmode;
/* Set what we are trying to extend and the operation it might
have been extended with. */
@@ -4940,10 +4940,12 @@ cse_insn (rtx_insn *insn)
PUT_CODE (memory_extend_rtx, extend_op);
XEXP (memory_extend_rtx, 0) = src;
- FOR_EACH_WIDER_MODE (tmode, int_mode)
+ opt_scalar_int_mode tmode_iter;
+ FOR_EACH_WIDER_MODE (tmode_iter, int_mode)
{
struct table_elt *larger_elt;
+ scalar_int_mode tmode = tmode_iter.require ();
if (GET_MODE_SIZE (tmode) > UNITS_PER_WORD)
break;