1. 03 Jan, 2018 40 commits
    • Use partial_subreg_p in curr_insn_transform · e5f83886
      Use partial_subreg_p in code that was added since the initial patch
      that introduced this function.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* lra-constraints.c (curr_insn_transform): Use partial_subreg_p.
      
      From-SVN: r256194
      Richard Sandiford committed
    • Add a fixed_size_mode_pod class · b660eccf
      This patch adds a POD version of fixed_size_mode.  The only current use
      is for storing the __builtin_apply and __builtin_result register modes,
      which were made fixed_size_modes by the previous patch.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* coretypes.h (fixed_size_mode): Declare.
      	(fixed_size_mode_pod): New typedef.
      	* builtins.h (target_builtins::x_apply_args_mode)
      	(target_builtins::x_apply_result_mode): Change type to
      	fixed_size_mode_pod.
      	* builtins.c (apply_args_size, apply_result_size, result_vector)
      	(expand_builtin_apply_args_1, expand_builtin_apply)
      	(expand_builtin_return): Update accordingly.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256193
      Richard Sandiford committed
    • Directly operate on CONST_VECTOR encoding · 16c78b66
      This patch makes some pieces of code operate directly on the new
      CONST_VECTOR encoding.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* cse.c (hash_rtx_cb): Hash only the encoded elements.
      	* cselib.c (cselib_hash_rtx): Likewise.
      	* expmed.c (make_tree): Build VECTOR_CSTs directly from the
      	CONST_VECTOR encoding.
      
      From-SVN: r256192
      Richard Sandiford committed
    • re PR target/83641 (-fstack-clash-protection generates incorrect CFI on i386) · 4bfb8e11
      	PR target/83641
      	* config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): For
      	noreturn probe, use gen_pop instead of ix86_emit_restore_reg_using_pop,
      	only set RTX_FRAME_RELATED_P on both the push and pop if cfa_reg is sp
      	and add REG_CFA_ADJUST_CFA notes in that case to both insns.
      
      	PR target/83641
      	* config/i386/i386.c (ix86_adjust_stack_and_probe_stack_clash): Do not
      	explicitly probe *sp in a noreturn function if there were any callee
      	register saves or frame pointer is needed.
      
      	PR target/83641
      	* gcc.target/i386/stack-check-17.c: New test.
      	* gcc.target/i386/stack-check-12.c: Drop unnecessary asm.
      
      From-SVN: r256191
      Jeff Law committed
    • re PR debug/83621 (ICE: in simplify_subreg, at simplify-rtx.c:6293 with -O -g) · e3bd1763
      	PR debug/83621
      	* cfgexpand.c (expand_debug_expr): Return NULL if mode is
      	BLKmode for ternary, binary or unary expressions.
      
      	* gcc.dg/pr83621.c: New test.
      
      From-SVN: r256190
      Jakub Jelinek committed
    • re PR debug/83645 (ICE: in get_insn_template, at final.c:2100 with -gstatement-frontiers) · e3a174d0
      	PR debug/83645
      	* var-tracking.c (delete_vta_debug_insn): New inline function.
      	(delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
      	insns from get_insns () to NULL instead of each bb separately.
      	Use delete_vta_debug_insn.  No longer static.
      	(vt_debug_insns_local, variable_tracking_main_1): Adjust
      	delete_vta_debug_insns callers.
      	* rtl.h (delete_vta_debug_insns): Declare.
      	* final.c (rest_of_handle_final): Call delete_vta_debug_insns
      	instead of variable_tracking_main.
      
      	* gcc.dg/pr83645.c: New test.
      
      From-SVN: r256189
      Jakub Jelinek committed
    • PR c/83559 - -Wsuggest-attribute=const conflicts with -Wattributes warning about… · a594cff3
      PR c/83559 - -Wsuggest-attribute=const conflicts with -Wattributes warning about const attribute on function returning void
      
      gcc/ChangeLog:
      
      	PR c/83559
      	* doc/extend.texi (attribute const): Fix a typo.
      	* ipa-pure-const.c ((warn_function_const, warn_function_pure): Avoid
      	issuing -Wsuggest-attribute for void functions.
      
      gcc/testsuite/ChangeLog:
      
      	PR c/83559
      	* gcc.dg/const-2.c: New test.
      	* gcc.dg/pure-3.c: New test.
      
      From-SVN: r256188
      Martin Sebor committed
    • gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use… · a6fd2cd7
      gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use offset_int::from instead of wide_int::to_shwi.
      
      
      gcc/ChangeLog:
      
      	* gimple-ssa-warn-restrict.c (builtin_memref::builtin_memref): Use
      	offset_int::from instead of wide_int::to_shwi.
      	(maybe_diag_overlap): Remove assertion.
      	Use HOST_WIDE_INT_PRINT_DEC instead of %lli.
      	* gimple-ssa-sprintf.c (format_directive): Same.
      	(parse_directive): Same.
      	(sprintf_dom_walker::compute_format_length): Same.
      	(try_substitute_return_value): Same.
      
      gcc/testsuite/ChangeLog:
      
      	* gcc.dg/Wrestrict-3.c: New test.
      
      From-SVN: r256187
      Martin Sebor committed
    • re PR c++/83555 (Unnecessary null check when static_cast is used with references.) · 830421fc
      	PR c++/83555
      	* typeck.c (build_static_cast_1): For static casts to reference types,
      	call build_base_path with flag_delete_null_pointer_checks as nonnull
      	instead of always false.  When -fsanitize=null, call
      	ubsan_maybe_instrument_reference on the NULL reference INTEGER_CST.
      	* cp-gimplify.c (cp_genericize_r): Don't walk subtrees of UBSAN_NULL
      	call if the first argument is INTEGER_CST with REFERENCE_TYPE.
      
      	* g++.dg/opt/pr83555.C: New test.
      	* g++.dg/ubsan/pr83555.C: New test.
      
      From-SVN: r256186
      Jakub Jelinek committed
    • Protect optional's deduction guide with the feature macro · 8bdbeed1
      * include/std/optional: Use the feature macro.
      
      From-SVN: r256185
      Ville Voutilainen committed
    • Fix warning in gcc.dg/plugin/expensive_selftests_plugin.c with !CHECKING_P · 72df5daa
      gcc/testsuite/ChangeLog:
      	* gcc.dg/plugin/expensive-selftests-1.c: Update regexp to handle
      	the !CHECKING_P case by expecting a note.
      	* gcc.dg/plugin/expensive_selftests_plugin.c (plugin_init): Issue
      	a note for the !CHECKING_P case, and move the return statement
      	outside of #if CHECKING_P guard.
      
      From-SVN: r256183
      David Malcolm committed
    • re PR middle-end/83654 (-fstack-clash-protection probes below the stack pointer… · 86aa0691
      re PR middle-end/83654 (-fstack-clash-protection probes below the stack pointer for VLA with constant size)
      
      	PR middle-end/83654
      	* explow.c (anti_adjust_stack_and_probe_stack_clash): Test a
      	non-constant residual for zero at runtime and avoid probing in
      	that case.  Reorganize code for trailing problem to mirror handling
      	of the residual.
      
      	PR middle-end/83654
      	* gcc.target/i386/stack-check-18.c: New test.
      	* gcc.target/i386/stack-check-19.c: New test.
      
      From-SVN: r256182
      Jeff Law committed
    • PR tree-optimization/83501 - strlen(a) not folded after strcpy(a, "...") · e95e79b6
      gcc/testsuite/ChangeLog:
      	* c-c++-common/Warray-bounds-3.c: Remove xfail.
      
      From-SVN: r256181
      Martin Sebor committed
    • re PR tree-optimization/83501 (strlen(a) not folded after strcpy(a, "...")) · 65f2d1ee
      2018-01-03  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
      
      	PR tree-optimization/83501
      	* tree-ssa-strlen.c (get_string_cst): New.
      	(handle_char_store): Call get_string_cst.
      
      testsuite/
      	* gcc.dg/tree-ssa/pr83501.c: New test.
      
      From-SVN: r256180
      Prathamesh Kulkarni committed
    • [PR c++/83667] Fix tree_dump ICE · ce473498
      https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00148.html
      	PR c++/83667
      	* method.c (make_alias_for): Copy DECL_CONTEXT.
      
      	PR c++/83667
      	* g++.dg/ipa/pr83667.C: New.
      
      From-SVN: r256179
      Nathan Sidwell committed
    • Clean-up EH after strlen transformation (PR tree-optimization/83593). · fa9544ab
      2018-01-03  Martin Liska  <mliska@suse.cz>
      
      	PR tree-optimization/83593
      	* tree-ssa-strlen.c: Include tree-cfg.h.
      	(strlen_check_and_optimize_stmt): Add new argument cleanup_eh.
      	(strlen_dom_walker): Add new member variable m_cleanup_cfg.
      	(strlen_dom_walker::strlen_dom_walker): Initialize m_cleanup_cfg
      	to false.
      	(strlen_dom_walker::before_dom_children): Call
      	gimple_purge_dead_eh_edges. Dump tranformation with details
      	dump flags.
      	(strlen_dom_walker::before_dom_children): Update call by adding
      	new argument cleanup_eh.
      	(pass_strlen::execute): Return TODO_cleanup_cfg if needed.
      2018-01-03  Martin Liska  <mliska@suse.cz>
      
      	PR tree-optimization/83593
      	* gcc.dg/pr83593.c: New test.
      
      From-SVN: r256178
      Martin Liska committed
    • Do not inline variadic thunks (PR ipa/83549). · ca04a532
      2018-01-03  Martin Liska  <mliska@suse.cz>
      
      	PR ipa/83549
      	* cif-code.def (VARIADIC_THUNK): New enum value.
      	* ipa-fnsummary.c (compute_fn_summary): Do not inline variadic
      	thunks.
      2018-01-03  Martin Liska  <mliska@suse.cz>
      
      	PR ipa/83549
      	* g++.dg/ipa/pr83549.C: New test.
      
      From-SVN: r256177
      Martin Liska committed
    • re PR c++/83592 (Annoying -Wparentheses warnings) · e164534f
      	PR c++/83592
      	* decl.c (grokdeclarator): Don't warn about MVP in typename context.
      
      	* g++.dg/warn/mvp2.C: New test.
      
      From-SVN: r256176
      Marek Polacek committed
    • re PR preprocessor/83602 (ICE in cpp_macro_definition_location(cpp_hashnode*) on invalid code) · e30947eb
      	PR preprocessor/83602
      	* name-lookup.c (lookup_name_fuzzy): Don't use macro_use_before_def
      	for builtin macros.
      
      	* g++.dg/cpp/pr83602.C: New test.
      
      From-SVN: r256175
      Jakub Jelinek committed
    • re PR c++/83634 (ICE in useless_type_conversion_p, at gimple-expr.c:86) · 19c37faa
      	PR c++/83634
      	* cp-gimplify.c (cp_fold) <case NOP_EXPR>: If the operand folds to
      	error_mark_node, return error_mark_node.
      
      	* g++.dg/parse/pr83634.C: New test.
      
      From-SVN: r256174
      Jakub Jelinek committed
    • re PR fortran/83664 (Eoshift accepts missing boundary for non-default types) · 8987beac
      2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/83664
      	* check.c (gfc_check_eoshift): Error for missing boundary if array
      	is not one of the standard types.
      
      2018-01-03  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/83664
      	* gfortran.dg/eoshift_7.f90: New test.
      
      From-SVN: r256171
      Thomas Koenig committed
    • x86: don't use AVX512BW vmovdqu variants without -mavx512bw · b853346e
      Simply mirror the MODE_XI logic of handling unaligned operands in
      mov<mode>_internal into MODE_TI / MODE_OI handling.
      
      gcc/
      2018-01-03  Jan Beulich  <jbeulich@suse.com>
      
      	* sse.md (mov<mode>_internal): Tighten condition for when to use
      	vmovdqu<ssescalarsize> for TI and OI modes.
      
      gcc/testsuite/
      2018-01-03  Jan Beulich  <jbeulich@suse.com>
      
      	* gcc.target/i386/avx512vl-no-vmovdqu8.c,
      	gcc.target/i386/avx512vl-no-vmovdqu16.c: New.
      
      From-SVN: r256170
      Jan Beulich committed
    • Update copyright years. · 85ec4feb
      From-SVN: r256169
      Jakub Jelinek committed
    • * update-copyright.py: Skip pdt-5.f03 in gfortran.dg subdir. · ada38d5f
      From-SVN: r256168
      Jakub Jelinek committed
    • Handle noipa attribute in IPA visibility (PR ipa/83594). · 99504686
      2018-01-03  Martin Liska  <mliska@suse.cz>
      
      	PR ipa/83594
      	* ipa-visibility.c (function_and_variable_visibility): Skip
      	functions with noipa attribure.
      2018-01-03  Martin Liska  <mliska@suse.cz>
      
      	PR ipa/83594
      	* gcc.dg/ipa/pr83594.c: New test.
      
      From-SVN: r256167
      Martin Liska committed
    • gcc.c (process_command): Update copyright notice dates. · 65e6aea3
      gcc/
      	* gcc.c (process_command): Update copyright notice dates.
      	* gcov-dump.c (print_version): Ditto.
      	* gcov.c (print_version): Ditto.
      	* gcov-tool.c (print_version): Ditto.
      	* gengtype.c (create_file): Ditto.
      	* doc/cpp.texi: Bump @copying's copyright year.
      	* doc/cppinternals.texi: Ditto.
      	* doc/gcc.texi: Ditto.
      	* doc/gccint.texi: Ditto.
      	* doc/gcov.texi: Ditto.
      	* doc/install.texi: Ditto.
      	* doc/invoke.texi: Ditto.
      gcc/fortran/
      	* gfortranspec.c (lang_specific_driver): Update copyright notice
      	dates.
      	* gfc-internals.texi: Bump @copying's copyright year.
      	* gfortran.texi: Ditto.
      	* intrinsic.texi: Ditto.
      	* invoke.texi: Ditto.
      gcc/ada/
       	* gnat_ugn.texi: Bump @copying's copyright year.
       	* gnat_rm.texi: Likewise.
      gcc/go/
      	* gccgo.texi: Bump @copyrights-go year.
      libitm/
      	* libitm.texi: Bump @copying's copyright year.
      libgomp/
      	* libgomp.texi: Bump @copying's copyright year.
      libquadmath/
      	* libquadmath.texi: Bump @copying's copyright year.
      
      From-SVN: r256166
      Jakub Jelinek committed
    • poly_int: vector_builder element count · 0ecc2b7d
      This patch changes the number of elements in a vector being built
      by a vector_builder from unsigned int to poly_uint64.  The case
      in which it isn't a constant is the one that motivated adding
      the vector encoding in the first place.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* vector-builder.h (vector_builder::m_full_nelts): Change from
      	unsigned int to poly_uint64.
      	(vector_builder::full_nelts): Update prototype accordingly.
      	(vector_builder::new_vector): Likewise.
      	(vector_builder::encoded_full_vector_p): Handle polynomial full_nelts.
      	(vector_builder::operator ==): Likewise.
      	(vector_builder::finalize): Likewise.
      	* int-vector-builder.h (int_vector_builder::int_vector_builder):
      	Take the number of elements as a poly_uint64 rather than an
      	unsigned int.
      	* vec-perm-indices.h (vec_perm_indices::m_nelts_per_input): Change
      	from unsigned int to poly_uint64.
      	(vec_perm_indices::vec_perm_indices): Update prototype accordingly.
      	(vec_perm_indices::new_vector): Likewise.
      	(vec_perm_indices::length): Likewise.
      	(vec_perm_indices::nelts_per_input): Likewise.
      	(vec_perm_indices::input_nelts): Likewise.
      	* vec-perm-indices.c (vec_perm_indices::new_vector): Take the
      	number of elements per input as a poly_uint64 rather than an
      	unsigned int.  Use the original encoding for variable-length
      	vectors, rather than clamping each individual element.
      	For the second and subsequent elements in each pattern,
      	clamp the step and base before clamping their sum.
      	(vec_perm_indices::series_p): Handle polynomial element counts.
      	(vec_perm_indices::all_in_range_p): Likewise.
      	(vec_perm_indices_to_tree): Likewise.
      	(vec_perm_indices_to_rtx): Likewise.
      	* tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise.
      	* tree-vector-builder.c (tree_vector_builder::new_unary_operation)
      	(tree_vector_builder::new_binary_operation): Handle polynomial
      	element counts.  Return false if we need to know the number
      	of elements at compile time.
      	* fold-const.c (fold_vec_perm): Punt if the number of elements
      	isn't known at compile time.
      
      From-SVN: r256165
      Richard Sandiford committed
    • poly_int: vec_perm_indices element type · 6b0630fb
      This patch changes the vec_perm_indices element type from HOST_WIDE_INT
      to poly_int64, so that it can represent indices into a variable-length
      vector.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      
      gcc/
      	* vec-perm-indices.h (vec_perm_builder): Change element type
      	from HOST_WIDE_INT to poly_int64.
      	(vec_perm_indices::element_type): Update accordingly.
      	(vec_perm_indices::clamp): Handle polynomial element_types.
      	* vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
      	(vec_perm_indices::all_in_range_p): Likewise.
      	(tree_to_vec_perm_builder): Check for poly_int64 trees rather
      	than shwi trees.
      	* vector-builder.h (vector_builder::stepped_sequence_p): Handle
      	polynomial vec_perm_indices element types.
      	* int-vector-builder.h (int_vector_builder::equal_p): Likewise.
      	* fold-const.c (fold_vec_perm): Likewise.
      	* optabs.c (shift_amt_for_vec_perm_mask): Likewise.
      	* tree-vect-generic.c (lower_vec_perm): Likewise.
      	* tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
      	* config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
      	element type to HOST_WIDE_INT.
      
      From-SVN: r256164
      Richard Sandiford committed
    • poly_int: memrefs_conflict_p · 9f61be58
      The xsize and ysize arguments to memrefs_conflict_p are encode such
      that:
      
      - 0 means the size is unknown
      - >0 means the size is known
      - <0 means that the negative of the size is a worst-case size after
        alignment
      
      In other words, the sign effectively encodes a boolean; it isn't
      meant to be taken literally.  With poly_ints these correspond to:
      
      - must_eq (..., 0)
      - may_gt (..., 0)
      - may_lt (..., 0)
      
      respectively.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* alias.c (addr_side_effect_eval): Take the size as a poly_int64
      	rather than an int.  Use plus_constant.
      	(memrefs_conflict_p): Take the sizes as poly_int64s rather than ints.
      	Take the offset "c" as a poly_int64 rather than a HOST_WIDE_INT.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256163
      Richard Sandiford committed
    • poly_int: struct_value_size · 5c8e61cf
      This patch makes calls.c treat struct_value_size (one of the
      operands to a call pattern) as polynomial.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* calls.c (emit_call_1, expand_call): Change struct_value_size from
      	a HOST_WIDE_INT to a poly_int64.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256162
      Richard Sandiford committed
    • poly_int: load_register_parameters · 95fe7b48
      This patch makes load_register_parameters cope with polynomial sizes.
      The requirement here is that any register parameters with non-constant
      sizes must either have a specific mode (e.g. a variable-length vector
      mode) or must be represented with a PARALLEL.  This is in practice
      already a requirement for parameters passed in vector registers,
      since the default behaviour of splitting parameters into words doesn't
      make sense for them.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* calls.c (load_register_parameters): Cope with polynomial
      	mode sizes.  Require a constant size for BLKmode parameters
      	that aren't described by a PARALLEL.  If BLOCK_REG_PADDING
      	forces a parameter to be padded at the lsb end in order to
      	fill a complete number of words, require the parameter size
      	to be ordered wrt UNITS_PER_WORD.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256161
      Richard Sandiford committed
    • poly_int: alter_reg · cff7107a
      This patch makes alter_reg cope with polynomial mode sizes.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* reload1.c (spill_stack_slot_width): Change element type
      	from unsigned int to poly_uint64_pod.
      	(alter_reg): Treat mode sizes as polynomial.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256160
      Richard Sandiford committed
    • poly_int: reloading complex subregs · 65f914e7
      This patch splits out a condition that is common to both push_reload
      and reload_inner_reg_of_subreg.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* reload.c (complex_word_subreg_p): New function.
      	(reload_inner_reg_of_subreg, push_reload): Use it.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256159
      Richard Sandiford committed
    • poly_int: process_alt_operands · 00224b1a
      This patch makes process_alt_operands check that the mode sizes
      are ordered, so that match_reload can validly treat them as subregs
      of one another.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* lra-constraints.c (process_alt_operands): Reject matched
      	operands whose sizes aren't ordered.
      	(match_reload): Refer to this check here.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256158
      Richard Sandiford committed
    • poly_int: expand_ifn_atomic_compare_exchange_into_call · 4871e1ed
      This patch makes the mode size assumptions in
      expand_ifn_atomic_compare_exchange_into_call a bit more
      explicit, so that a later patch can add a to_constant () call.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* builtins.c (expand_ifn_atomic_compare_exchange_into_call): Assert
      	that the mode size is in the set {1, 2, 4, 8, 16}.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256157
      Richard Sandiford committed
    • poly_int: adjust_mems · 0f5d0928
      This patch makes the var-tracking.c handling of autoinc addresses
      cope with polynomial mode sizes.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* var-tracking.c (adjust_mems): Treat mode sizes as polynomial.
      	Use plus_constant instead of gen_rtx_PLUS.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256156
      Richard Sandiford committed
    • poly_int: PUSH_ROUNDING · 7b4df2bf
      PUSH_ROUNDING is difficult to convert to a hook since there is still
      a lot of conditional code based on it.  It isn't clear that a direct
      conversion with checks for null hooks is the right thing to do.
      
      Rather than untangle that, this patch converts all implementations
      that do something to out-of-line functions that have the same
      interface as a hook would have.  This should at least help towards
      any future hook conversion.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
      	* config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
      	* config/cr16/cr16.c (cr16_push_rounding): ...this new function.
      	* config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
      	* config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
      	* config/h8300/h8300.c (h8300_push_rounding): ...this new function.
      	* config/i386/i386-protos.h (ix86_push_rounding): Declare.
      	* config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
      	* config/i386/i386.c (ix86_push_rounding): ...this new function.
      	* config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
      	a poly_int64.
      	* config/m32c/m32c.c (m32c_push_rounding): Likewise.
      	* config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
      	* config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
      	* config/m68k/m68k.c (m68k_push_rounding): ...this new function.
      	* config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
      	* config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
      	* config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
      	* config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
      	* config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
      	* config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
      	function.
      	* expr.c (emit_move_resolve_push): Treat the input and result
      	of PUSH_ROUNDING as a poly_int64.
      	(emit_move_complex_push, emit_single_push_insn_1): Likewise.
      	(emit_push_insn): Likewise.
      	* lra-eliminations.c (mark_not_eliminable): Likewise.
      	* recog.c (push_operand): Likewise.
      	* reload1.c (elimination_effects): Likewise.
      	* rtlanal.c (nonzero_bits1): Likewise.
      	* calls.c (store_one_arg): Likewise.  Require the padding to be
      	known at compile time.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256155
      Richard Sandiford committed
    • poly_int: emit_single_push_insn_1 · a930fe51
      This patch makes emit_single_push_insn_1 cope with polynomial mode sizes.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
      	Use plus_constant instead of gen_rtx_PLUS.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256154
      Richard Sandiford committed
    • poly_int: set_inc_state · b2e894a8
      This trivial patch makes auto-inc-dec.c:set_inc_state take a poly_int64.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64
      	rather than an int.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256153
      Richard Sandiford committed
    • poly_int: expand_expr_real_1 · f3ff4900
      This patch makes the VIEW_CONVERT_EXPR handling in expand_expr_real_1
      cope with polynomial type and mode sizes.
      
      2018-01-03  Richard Sandiford  <richard.sandiford@linaro.org>
      	    Alan Hayward  <alan.hayward@arm.com>
      	    David Sherwood  <david.sherwood@arm.com>
      
      gcc/
      	* expr.c (expand_expr_real_1): Use tree_to_poly_uint64
      	instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs
      	via stack temporaries.  Treat the mode size as polynomial too.
      
      Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
      Co-Authored-By: David Sherwood <david.sherwood@arm.com>
      
      From-SVN: r256152
      Richard Sandiford committed