[19/77] Add a smallest_int_mode_for_size helper function
commit1a5d4b274e338ab09779e1b068026e883c964df8
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:10:44 +0000 (30 11:10 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:10:44 +0000 (30 11:10 +0000)
treea08f3d32bc93a70f1da4b61931edf7ce88da32b3
parent2cf1bb2548bf9ce652251e4f7870e67b080acf56
[19/77] Add a smallest_int_mode_for_size helper function

This patch adds a wrapper around smallest_mode_for_size
for cases in which the mode class is MODE_INT.  Unlike
(int_)mode_for_size, smallest_mode_for_size always returns
a mode of the specified class, asserting if no such mode exists.
smallest_int_mode_for_size therefore returns a scalar_int_mode
rather than an opt_scalar_int_mode.

2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* machmode.h (smallest_mode_for_size): Fix formatting.
(smallest_int_mode_for_size): New function.
* cfgexpand.c (expand_debug_expr): Use smallest_int_mode_for_size
instead of smallest_mode_for_size.
* combine.c (make_extraction): Likewise.
* config/arc/arc.c (arc_expand_movmem): Likewise.
* config/arm/arm.c (arm_expand_divmod_libfunc): Likewise.
* config/i386/i386.c (ix86_get_mask_mode): Likewise.
* config/s390/s390.c (s390_expand_insv): Likewise.
* config/sparc/sparc.c (assign_int_registers): Likewise.
* config/spu/spu.c (spu_function_value): Likewise.
(spu_function_arg): Likewise.
* coverage.c (get_gcov_type): Likewise.
(get_gcov_unsigned_t): Likewise.
* dse.c (find_shift_sequence): Likewise.
* expmed.c (store_bit_field_1): Likewise.
* expr.c (convert_move): Likewise.
(store_field): Likewise.
* internal-fn.c (expand_arith_overflow): Likewise.
* optabs-query.c (get_best_extraction_insn): Likewise.
* optabs.c (expand_twoval_binop_libfunc): Likewise.
* stor-layout.c (layout_type): Likewise.
(initialize_sizetypes): Likewise.
* targhooks.c (default_get_mask_mode): Likewise.
* tree-ssa-loop-manip.c (canonicalize_loop_ivs): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251471 138bc75d-0d04-0410-961f-82ee72b054a4
20 files changed:
gcc/ChangeLog
gcc/cfgexpand.c
gcc/combine.c
gcc/config/arc/arc.c
gcc/config/arm/arm.c
gcc/config/i386/i386.c
gcc/config/s390/s390.c
gcc/config/sparc/sparc.c
gcc/config/spu/spu.c
gcc/coverage.c
gcc/dse.c
gcc/expmed.c
gcc/expr.c
gcc/internal-fn.c
gcc/machmode.h
gcc/optabs-query.c
gcc/optabs.c
gcc/stor-layout.c
gcc/targhooks.c
gcc/tree-ssa-loop-manip.c