This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r251457 - in /trunk/gcc: ChangeLog ada/ChangeLo...


Author: rsandifo
Date: Wed Aug 30 11:09:01 2017
New Revision: 251457

URL: https://gcc.gnu.org/viewcvs?rev=251457&root=gcc&view=rev
Log:
[6/77] Make GET_MODE_WIDER return an opt_mode

GET_MODE_WIDER previously returned VOIDmode if no wider mode existed.
That would cause problems with stricter mode classes, since VOIDmode
isn't for example a valid scalar integer or floating-point mode.
This patch instead makes it return a new opt_mode<T> class, which
holds either a T or nothing.

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

gcc/
	* coretypes.h (opt_mode): New class.
	* machmode.h (opt_mode): Likewise.
	(opt_mode::else_void): New function.
	(opt_mode::require): Likewise.
	(opt_mode::exists): Likewise.
	(GET_MODE_WIDER_MODE): Turn into a function and return an opt_mode.
	(GET_MODE_2XWIDER_MODE): Likewise.
	(mode_iterator::get_wider): Update accordingly.
	(mode_iterator::get_2xwider): Likewise.
	(mode_iterator::get_known_wider): Likewise, turning into a template.
	* combine.c (make_extraction): Update use of GET_MODE_WIDER_MODE,
	forcing a wider mode to exist.
	* config/cr16/cr16.h (LONG_REG_P): Likewise.
	* rtlanal.c (init_num_sign_bit_copies_in_rep): Likewise.
	* config/c6x/c6x.c (c6x_rtx_costs): Update use of
	GET_MODE_2XWIDER_MODE, forcing a wider mode to exist.
	* lower-subreg.c (init_lower_subreg): Likewise.
	* optabs-libfuncs.c (init_sync_libfuncs_1): Likewise, but not
	on the final iteration.
	* config/i386/i386.c (ix86_expand_set_or_movmem): Check whether
	a wider mode exists before asking for a move pattern.
	(get_mode_wider_vector): Update use of GET_MODE_WIDER_MODE,
	forcing a wider mode to exist.
	(expand_vselect_vconcat): Update use of GET_MODE_2XWIDER_MODE,
	returning false if no such mode exists.
	* config/ia64/ia64.c (expand_vselect_vconcat): Likewise.
	* config/mips/mips.c (mips_expand_vselect_vconcat): Likewise.
	* expmed.c (init_expmed_one_mode): Update use of GET_MODE_WIDER_MODE.
	Avoid checking for a MODE_INT if we already know the mode is not a
	SCALAR_INT_MODE_P.
	(extract_high_half): Update use of GET_MODE_WIDER_MODE,
	forcing a wider mode to exist.
	(expmed_mult_highpart_optab): Likewise.
	(expmed_mult_highpart): Likewise.
	* expr.c (expand_expr_real_2): Update use of GET_MODE_WIDER_MODE,
	using else_void.
	* lto-streamer-in.c (lto_input_mode_table): Likewise.
	* optabs-query.c (find_widening_optab_handler_and_mode): Likewise.
	* stor-layout.c (bit_field_mode_iterator::next_mode): Likewise.
	* internal-fn.c (expand_mul_overflow): Update use of
	GET_MODE_2XWIDER_MODE.
	* omp-low.c (omp_clause_aligned_alignment): Likewise.
	* tree-ssa-math-opts.c (convert_mult_to_widen): Update use of
	GET_MODE_WIDER_MODE.
	(convert_plusminus_to_widen): Likewise.
	* tree-switch-conversion.c (array_value_type): Likewise.
	* var-tracking.c (emit_note_insn_var_location): Likewise.
	* tree-vrp.c (simplify_float_conversion_using_ranges): Likewise.
	Return false inside rather than outside the loop if no wider mode
	exists
	* optabs.c (expand_binop): Update use of GET_MODE_WIDER_MODE
	and GET_MODE_2XWIDER_MODE
	(can_compare_p): Use else_void.
	* gdbhooks.py (OptMachineModePrinter): New class.
	(build_pretty_printer): Use it for opt_mode.

gcc/ada/
	* gcc-interface/decl.c (validate_size): Update use of
	GET_MODE_WIDER_MODE, forcing a wider mode to exist.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/gcc-interface/decl.c
    trunk/gcc/combine.c
    trunk/gcc/config/c6x/c6x.c
    trunk/gcc/config/cr16/cr16.h
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/ia64/ia64.c
    trunk/gcc/config/mips/mips.c
    trunk/gcc/coretypes.h
    trunk/gcc/expmed.c
    trunk/gcc/expr.c
    trunk/gcc/gdbhooks.py
    trunk/gcc/internal-fn.c
    trunk/gcc/lower-subreg.c
    trunk/gcc/lto-streamer-in.c
    trunk/gcc/machmode.h
    trunk/gcc/omp-low.c
    trunk/gcc/optabs-libfuncs.c
    trunk/gcc/optabs-query.c
    trunk/gcc/optabs.c
    trunk/gcc/rtlanal.c
    trunk/gcc/stor-layout.c
    trunk/gcc/tree-ssa-math-opts.c
    trunk/gcc/tree-switch-conversion.c
    trunk/gcc/tree-vrp.c
    trunk/gcc/var-tracking.c


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]