diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-08-30 11:13:29 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-08-30 11:13:29 +0000 |
commit | 7a6aeeed20782f8249a247a23eee1f9b8f750104 (patch) | |
tree | 39a850b1263916714cd0fc62162dc9adaf993d73 /gcc/cfgexpand.c | |
parent | 03b7a719c910892d187b21e406058a5d8324c158 (diff) | |
download | gcc-7a6aeeed20782f8249a247a23eee1f9b8f750104.tar.gz |
[35/77] Add uses of as_a <scalar_int_mode>
This patch adds asserting as_a <scalar_int_mode> conversions
to contexts in which the input is known to be a scalar integer mode.
In expand_divmod, op1 is always a scalar_int_mode if
op1_is_constant (but might not be otherwise).
In expand_binop, the patch reverses a < comparison in order to
avoid splitting a long line.
gcc/
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* cfgexpand.c (convert_debug_memory_address): Use
as_a <scalar_int_mode>.
* combine.c (expand_compound_operation): Likewise.
(make_extraction): Likewise.
(change_zero_ext): Likewise.
(simplify_comparison): Likewise.
* cse.c (cse_insn): Likewise.
* dwarf2out.c (minmax_loc_descriptor): Likewise.
(mem_loc_descriptor): Likewise.
(loc_descriptor): Likewise.
* expmed.c (init_expmed_one_mode): Likewise.
(synth_mult): Likewise.
(emit_store_flag_1): Likewise.
(expand_divmod): Likewise. Use HWI_COMPUTABLE_MODE_P instead
of a comparison with size.
* expr.c (expand_assignment): Use as_a <scalar_int_mode>.
(reduce_to_bit_field_precision): Likewise.
* function.c (expand_function_end): Likewise.
* internal-fn.c (expand_arith_overflow_result_store): Likewise.
* loop-doloop.c (doloop_modify): Likewise.
* optabs.c (expand_binop): Likewise.
(expand_unop): Likewise.
(expand_copysign_absneg): Likewise.
(prepare_cmp_insn): Likewise.
(maybe_legitimize_operand): Likewise.
* recog.c (const_scalar_int_operand): Likewise.
* rtlanal.c (get_address_mode): Likewise.
* simplify-rtx.c (simplify_unary_operation_1): Likewise.
(simplify_cond_clz_ctz): Likewise.
* tree-nested.c (get_nl_goto_field): Likewise.
* tree.c (build_vector_type_for_mode): Likewise.
* var-tracking.c (use_narrower_mode): Likewise.
gcc/c-family/
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* c-common.c (c_common_type_for_mode): Use as_a <scalar_int_mode>.
gcc/lto/
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* lto-lang.c (lto_type_for_mode): Use as_a <scalar_int_mode>.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251487 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 8e93ce83bda..34350de2e82 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -3965,12 +3965,10 @@ static rtx convert_debug_memory_address (machine_mode mode, rtx x, addr_space_t as) { - machine_mode xmode = GET_MODE (x); - #ifndef POINTERS_EXTEND_UNSIGNED gcc_assert (mode == Pmode || mode == targetm.addr_space.address_mode (as)); - gcc_assert (xmode == mode || xmode == VOIDmode); + gcc_assert (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode); #else rtx temp; @@ -3979,6 +3977,8 @@ convert_debug_memory_address (machine_mode mode, rtx x, if (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode) return x; + /* X must have some form of address mode already. */ + scalar_int_mode xmode = as_a <scalar_int_mode> (GET_MODE (x)); if (GET_MODE_PRECISION (mode) < GET_MODE_PRECISION (xmode)) x = lowpart_subreg (mode, x, xmode); else if (POINTERS_EXTEND_UNSIGNED > 0) |