1. 23 Sep, 2019 3 commits
  2. 22 Sep, 2019 3 commits
  3. 21 Sep, 2019 7 commits
    • PR middle-end/91830 - Bogus -Warray-bounds on strcpy into a member · 81011859
      PR middle-end/91830 - Bogus -Warray-bounds on strcpy into a member
      of a subobject compiling binutils
      
      gcc/ChangeLog:
      	* gcc/gimple-ssa-warn-restrict.c (builtin_memref::set_base_and_offset):
      	Simplify computation of the offset of the referenced subobject.
      
      gcc/testsuite/ChangeLog:
      	* gcc/testsuite/gcc.dg/Warray-bounds-47.c: New test.
      
      From-SVN: r276022
      Martin Sebor committed
    • re PR c++/30277 (bit-field: wrong overload resolution) · e4df9be4
      	PR c++/30277
      	* g++.dg/expr/bitfield14.C (struct S): Use signed long long instead
      	of signed long.
      	(foo): Use long long instead of long.
      
      From-SVN: r276021
      Jakub Jelinek committed
    • [Darwin] Update machopic_legitimize_pic_address. · 6bd2a4f3
      Some changes were missed here in the transition to LRA.  The Darwin
      archs are all using LRA now.
      
      gcc/ChangeLog:
      
      2019-09-21  Iain Sandoe  <iain@sandoe.co.uk>
      
      	* config/darwin.c (machopic_legitimize_pic_address): Check
      	for lra not reload.
      
      From-SVN: r276020
      Iain Sandoe committed
    • DR 2345 - Jumping across initializers in init-statements and conditions. · 296580b6
      	* g++.dg/cpp1z/init-statement10.C: New test.
      
      From-SVN: r276019
      Marek Polacek committed
    • Avoid adding impossible copies in ira-conflicts.c:process_reg_shuffles · 9f635bd1
      If an insn requires two operands to be tied, and the input operand dies
      in the insn, IRA acts as though there were a copy from the input to the
      output with the same execution frequency as the insn.  Allocating the
      same register to the input and the output then saves the cost of a move.
      
      If there is no such tie, but an input operand nevertheless dies
      in the insn, IRA creates a similar move, but with an eighth of the
      frequency.  This helps to ensure that chains of instructions reuse
      registers in a natural way, rather than using arbitrarily different
      registers for no reason.
      
      This heuristic seems to work well in the vast majority of cases.
      However, for SVE, the handling of untied operands ends up creating
      copies between dying predicate registers and vector outputs, even though
      vector and predicate registers are distinct classes and can never be
      tied.  This is a particular problem because the dying predicate tends
      to be the loop control predicate, which is used by most instructions
      in a vector loop and so (rightly) has a very high allocation priority.
      Any copies involving the loop predicate therefore tend to get processed
      before copies involving only vector registers.  The end result is that
      we tend to allocate the output of the last vector instruction in a loop
      ahead of its natural place in the allocation order and don't benefit
      from chains created between vector registers.
      
      This patch tries to avoid the problem by not adding register shuffle
      copies if there appears to be no chance that the two operands could be
      allocated to the same register.
      
      2019-09-21  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/
      	* ira-conflicts.c (can_use_same_reg_p): New function.
      	(process_reg_shuffles): Take an insn parameter.  Ignore cases
      	in which input operand op_num could seemingly never be allocated
      	to the same register as the destination.
      	(add_insn_allocno_copies): Update call to process_reg_shuffles.
      
      gcc/testsuite/
      	* gcc.target/aarch64/sve/cond_convert_1.c: Remove XFAILs.
      	* gcc.target/aarch64/sve/cond_convert_4.c: Likewise.
      	* gcc.target/aarch64/sve/cond_unary_2.c: Likewise.
      
      From-SVN: r276018
      Richard Sandiford committed
    • Extend neg_const_int simplifications to other const rtxes · 681fc0fa
      This patch generalises some neg_const_int-based rtx simplifications
      so that they handle all CONST_SCALAR_INTs and also CONST_POLY_INT.
      This actually simplifies things a bit, since we no longer have
      to treat HOST_WIDE_INT_MIN specially.
      
      This is tested by later SVE patches.
      
      2019-09-21  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/
      	* simplify-rtx.c (neg_const_int): Replace with...
      	(neg_poly_int_rtx): ...this new function.
      	(simplify_binary_operation_1): Extend (minus x C) -> (plus X -C)
      	to all CONST_SCALAR_INTs and to CONST_POLY_INT.
      	(simplify_plus_minus): Likewise for constant terms here.
      
      From-SVN: r276017
      Richard Sandiford committed
    • Daily bump. · b2addbf4
      From-SVN: r276015
      GCC Administrator committed
  4. 20 Sep, 2019 14 commits
  5. 19 Sep, 2019 13 commits
    • New IPA-SRA · ff6686d2
      2019-09-20  Martin Jambor  <mjambor@suse.cz>
      
              * coretypes.h (cgraph_edge): Declare.
              * ipa-param-manipulation.c: Rewrite.
              * ipa-param-manipulation.h: Likewise.
              * Makefile.in (GTFILES): Added ipa-param-manipulation.h and ipa-sra.c.
              (OBJS): Added ipa-sra.o.
              * cgraph.h (ipa_replace_map): Removed fields old_tree, replace_p
              and ref_p, added fields param_adjustments and performed_splits.
              (struct cgraph_clone_info): Remove ags_to_skip and
              combined_args_to_skip, new field param_adjustments.
              (cgraph_node::create_clone): Changed parameters to use
              ipa_param_adjustments.
              (cgraph_node::create_virtual_clone): Likewise.
              (cgraph_node::create_virtual_clone_with_body): Likewise.
              (tree_function_versioning): Likewise.
              (cgraph_build_function_type_skip_args): Removed.
              * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Convert to
              using ipa_param_adjustments.
              (clone_of_p): Likewise.
              * cgraphclones.c (cgraph_build_function_type_skip_args): Removed.
              (build_function_decl_skip_args): Likewise.
              (duplicate_thunk_for_node): Adjust parameters using
              ipa_param_body_adjustments, copy param_adjustments instead of
              args_to_skip.
              (cgraph_node::create_clone): Convert to using ipa_param_adjustments.
              (cgraph_node::create_virtual_clone): Likewise.
              (cgraph_node::create_version_clone_with_body): Likewise.
              (cgraph_materialize_clone): Likewise.
              (symbol_table::materialize_all_clones): Likewise.
              * ipa-fnsummary.c (ipa_fn_summary_t::duplicate): Simplify
              ipa_replace_map check.
              * ipa-cp.c (get_replacement_map): Do not initialize removed fields.
              (initialize_node_lattices): Make aware that some parameters might have
              already been removed.
              (want_remove_some_param_p): New function.
              (create_specialized_node): Convert to using ipa_param_adjustments and
              deal with possibly pre-existing adjustments.
              * lto-cgraph.c (output_cgraph_opt_summary_p): Likewise.
              (output_node_opt_summary): Do not stream removed fields.  Stream
              parameter adjustments instead of argumetns to skip.
              (input_node_opt_summary): Likewise.
              (input_node_opt_summary): Likewise.
              * lto-section-in.c (lto_section_name): Added ipa-sra section.
              * lto-streamer.h (lto_section_type): Likewise.
              * tree-inline.h (copy_body_data): New fields killed_new_ssa_names and
      	param_body_adjs.
              (copy_decl_to_var): Declare.
              * tree-inline.c (update_clone_info): Do not remap old_tree.
              (remap_gimple_stmt): Use ipa_param_body_adjustments to modify gimple
              statements, walk all extra generated statements and remap their
              operands.
              (redirect_all_calls): Add killed SSA names to a hash set.
              (remap_ssa_name): Do not remap killed SSA names.
              (copy_arguments_for_versioning): Renames to copy_arguments_nochange,
              half of functionality moved to ipa_param_body_adjustments.
              (copy_decl_to_var): Make exported.
              (copy_body): Destroy killed_new_ssa_names hash set.
              (expand_call_inline): Remap performed splits.
              (update_clone_info): Likewise.
              (tree_function_versioning): Simplify tree_map processing.  Updated to
              accept ipa_param_adjustments and use ipa_param_body_adjustments.
              * omp-simd-clone.c (simd_clone_vector_of_formal_parm_types): Adjust
              for the new interface.
              (simd_clone_clauses_extract): Likewise, make args an auto_vec.
              (simd_clone_compute_base_data_type): Likewise.
              (simd_clone_init_simd_arrays): Adjust for the new interface.
              (simd_clone_adjust_argument_types): Likewise.
              (struct modify_stmt_info): Likewise.
              (ipa_simd_modify_stmt_ops): Likewise.
              (ipa_simd_modify_function_body): Likewise.
              (simd_clone_adjust): Likewise.
              * tree-sra.c: Removed IPA-SRA.  Include tree-sra.h.
              (type_internals_preclude_sra_p): Make public.
              * tree-sra.h: New file.
              * ipa-inline-transform.c (save_inline_function_body): Update to
              refelct new tree_function_versioning signature.
              * ipa-prop.c (adjust_agg_replacement_values): Use a helper from
              ipa_param_adjustments to get current parameter indices.
              (ipcp_modif_dom_walker::before_dom_children): Likewise.
              (ipcp_update_bits): Likewise.
              (ipcp_update_vr): Likewise.
              * ipa-split.c (split_function): Convert to using ipa_param_adjustments.
              * ipa-sra.c: New file.
              * multiple_target.c (create_target_clone): Update to reflet new type
              of create_version_clone_with_body.
              * trans-mem.c (ipa_tm_create_version): Update to reflect new type of
              tree_function_versioning.
      	(modify_function): Update to reflect new type of
      	tree_function_versioning.
              * params.def (PARAM_IPA_SRA_MAX_REPLACEMENTS): New.
              * passes.def: Remove old IPA-SRA and add new one.
              * tree-pass.h (make_pass_early_ipa_sra): Remove declaration.
              (make_pass_ipa_sra): Declare.
      	* dbgcnt.def: Remove eipa_sra.  Added ipa_sra_params and
      	ipa_sra_retvalues.
      	* doc/invoke.texi (ipa-sra-max-replacements): New.
      
              testsuite/
              * g++.dg/ipa/pr81248.C: Adjust dg-options and dump-scan.
              * gcc.dg/ipa/ipa-sra-1.c: Likewise.
              * gcc.dg/ipa/ipa-sra-10.c: Likewise.
              * gcc.dg/ipa/ipa-sra-11.c: Likewise.
              * gcc.dg/ipa/ipa-sra-3.c: Likewise.
              * gcc.dg/ipa/ipa-sra-4.c: Likewise.
              * gcc.dg/ipa/ipa-sra-5.c: Likewise.
              * gcc.dg/ipa/ipacost-2.c: Disable ipa-sra.
              * gcc.dg/ipa/ipcp-agg-9.c: Likewise.
              * gcc.dg/ipa/pr78121.c: Adjust scan pattern.
              * gcc.dg/ipa/vrp1.c: Likewise.
              * gcc.dg/ipa/vrp2.c: Likewise.
              * gcc.dg/ipa/vrp3.c: Likewise.
              * gcc.dg/ipa/vrp7.c: Likewise.
              * gcc.dg/ipa/vrp8.c: Likewise.
              * gcc.dg/noreorder.c: use noipa attribute instead of noinline.
              * gcc.dg/ipa/20040703-wpa.c: New test.
      	* gcc.dg/ipa/ipa-sra-12.c: New test.
      	* gcc.dg/ipa/ipa-sra-13.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-14.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-15.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-16.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-17.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-18.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-19.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-20.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-21.c: Likewise.
      	* gcc.dg/ipa/ipa-sra-22.c: Likewise.
      	* gcc.dg/sso/ipa-sra-1.c: Likewise.
      	* g++.dg/ipa/ipa-sra-2.C: Likewise.
      	* g++.dg/ipa/ipa-sra-3.C: Likewise.
      	* gcc.dg/tree-ssa/ipa-cp-1.c: Make return value used.
      	* g++.dg/ipa/devirt-19.C: Add missing return, add -fipa-cp-clone
      	option.
      	* g++.dg/lto/devirt-19_0.C: Add -fipa-cp-clone option.
      	* gcc.dg/ipa/ipa-sra-2.c: Removed.
      	* gcc.dg/ipa/ipa-sra-6.c: Likewise.
      
      From-SVN: r275982
      Martin Jambor committed
    • PR middle-end/91631 - buffer overflow into an array member of a declared object not detected · 6889a3ac
      gcc/ChangeLog:
      
      	PR middle-end/91631
      	* builtins.c (component_size): Correct trailing array computation,
      	rename to component_ref_size and move...
      	(compute_objsize): Adjust.
      	* gimple-ssa-warn-restrict.c (builtin_memref::refsize): New member.
      	(builtin_access::strict): Do not consider mememmove.
      	(builtin_access::write_off): New function.
      	(builtin_memref::builtin_memref): Initialize refsize.
      	(builtin_memref::set_base_and_offset): Adjust refoff and compute
      	refsize.
      	(builtin_memref::offset_out_of_bounds): Use ooboff input values.
      	Handle refsize.
      	(builtin_access::builtin_access): Intialize dstoff to destination
      	refeence offset here instead of in maybe_diag_overlap.  Adjust
      	referencess even to unrelated objects.	Adjust sizrange of bounded
      	string functions to reflect bound.  For strcat, adjust destination
      	sizrange by that of source.
      	(builtin_access::strcat_overlap):  Adjust offsets and sizes
      	to reflect the increase in destination sizrange above.
      	(builtin_access::overlap): Do not set dstoff here but instead
      	in builtin_access::builtin_access.
      	(check_bounds_or_overlap): Use builtin_access::write_off.
      	(maybe_diag_access_bounds): Add argument.  Add informational notes.
      	(dump_builtin_memref, dump_builtin_access): New functions.
      	* tree.c (component_ref_size): ...to here.
      	* tree.h (component_ref_size): Declare.
      	* tree-ssa-strlen (handle_builtin_strcat): Include the terminating
      	nul in the size of the source string.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/91631
      	* /c-c++-common/Warray-bounds-3.c: Correct expected offsets.
      	* /c-c++-common/Warray-bounds-4.c: Same.
      	* gcc.dg/Warray-bounds-39.c: Remove xfails.
      	* gcc.dg/Warray-bounds-45.c: New test.
      	* gcc.dg/Warray-bounds-46.c: New test.
      
      From-SVN: r275981
      Martin Sebor committed
    • Support extended characters in C/C++ identifiers (PR c/67224) · 7d112d66
      libcpp/ChangeLog
      2019-09-19  Lewis Hyatt  <lhyatt@gmail.com>
      
      	PR c/67224
      	* charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
      	* internal.h (_cpp_valid_utf8): Declare.
      	* lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
      	(_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
      	Do all work in "default" case to avoid slowing down typical code paths.
      	Also handle $ and UCN in the default case for consistency.
      
      gcc/Changelog
      2019-09-19  Lewis Hyatt  <lhyatt@gmail.com>
      
      	PR c/67224
      	* doc/cpp.texi: Document support for extended characters in
      	identifiers.
      	* doc/cppopts.texi: Likewise.
      
      gcc/testsuite/ChangeLog
      2019-09-19  Lewis Hyatt  <lhyatt@gmail.com>
      
      	PR c/67224
      	* c-c++-common/cpp/ucnid-2011-1-utf8.c: New test.
      	* g++.dg/cpp/ucnid-1-utf8.C: New test.
      	* g++.dg/cpp/ucnid-2-utf8.C: New test.
      	* g++.dg/cpp/ucnid-3-utf8.C: New test.
      	* g++.dg/cpp/ucnid-4-utf8.C: New test.
      	* g++.dg/other/ucnid-1-utf8.C: New test.
      	* gcc.dg/cpp/ucnid-1-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-10-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-11-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-12-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-13-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-14-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-15-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-2-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-3-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-4-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-6-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-7-utf8.c: New test.
      	* gcc.dg/cpp/ucnid-9-utf8.c: New test.
      	* gcc.dg/ucnid-1-utf8.c: New test.
      	* gcc.dg/ucnid-10-utf8.c: New test.
      	* gcc.dg/ucnid-11-utf8.c: New test.
      	* gcc.dg/ucnid-12-utf8.c: New test.
      	* gcc.dg/ucnid-13-utf8.c: New test.
      	* gcc.dg/ucnid-14-utf8.c: New test.
      	* gcc.dg/ucnid-15-utf8.c: New test.
      	* gcc.dg/ucnid-16-utf8.c: New test.
      	* gcc.dg/ucnid-2-utf8.c: New test.
      	* gcc.dg/ucnid-3-utf8.c: New test.
      	* gcc.dg/ucnid-4-utf8.c: New test.
      	* gcc.dg/ucnid-5-utf8.c: New test.
      	* gcc.dg/ucnid-6-utf8.c: New test.
      	* gcc.dg/ucnid-7-utf8.c: New test.
      	* gcc.dg/ucnid-8-utf8.c: New test.
      	* gcc.dg/ucnid-9-utf8.c: New test.
      
      From-SVN: r275979
      Lewis Hyatt committed
    • Handle [[likely]] on compound-statement. · e0710fcf
      I overlooked this case when adding [[likely]] handling to
      cp_parser_statement.
      
      	* parser.c (cp_parser_statement): Handle [[likely]] on
      	compound-statement.
      
      From-SVN: r275978
      Jason Merrill committed
    • [Darwin, PPC, testsuite] Fix pr89313.c fail. · a519efbe
      Darwin defines '__POWERPC__' rather than '__powerpc__' so check for
      the upper case version too in order to select the correct register
      name.
      
      gcc/testsuite:
      
      2019-09-19  Iain Sandoe  <iain@sandoe.co.uk>
      
      	* gcc.dg/pr89313.c: Test for __POWERPC__ in addition to
      	__powerpc__ in register name selection.
      
      From-SVN: r275977
      Iain Sandoe committed
    • Revert "Fix conversions for built-in operator overloading candidates." · e564cf98
      This reverts commit 948d5b831affef14a49f56804b01e3f1ba00cdb3.
      
      From-SVN: r275976
      Jason Merrill committed
    • tree-vect-loop.c (vect_is_slp_reduction): Remove. · b3c4d0dd
      2019-09-19  Richard Biener  <rguenther@suse.de>
      
      	* tree-vect-loop.c (vect_is_slp_reduction): Remove.
      	(check_reduction_path): New overload having the path as result.
      	(vect_is_simple_reduction): From the detected reduction
      	path build a SLP reduction chain if possible.
      
      From-SVN: r275972
      Richard Biener committed
    • re PR target/91814 (ICE in elimination_costs_in_insn, at reload1.c:3549 since r274926) · 54dc8577
      2019-09-19  Richard Biener  <rguenther@suse.de>
      
      	PR target/91814
      	* config/i386/i386-features.c (gen_gpr_to_xmm_move_src):
      	Force operand to a register if it isn't nonimmediate_operand.
      
      From-SVN: r275971
      Richard Biener committed
    • [ARM] Simplify logical DImode iterators · 40858b9d
      Further simplify the logical DImode expander using code iterator and
      obtab attributes.  This avoids adding unnecessary code_attr entries.
      
          gcc/
      	* config/arm/arm.md (<logical_op>di3): Use <optab> and <CODE>.
      	* config/arm/iterators.md (optab): Add and, ior, xor entries.
      	(logical_op): Remove code attribute.
      	(logical_OP): Likewise.
      
      From-SVN: r275970
      Wilco Dijkstra committed
    • Fix cast in sort_congruence_class_groups_by_decl_uid. · 9f576d30
      2019-09-19  Martin Liska  <mliska@suse.cz>
      
      	* ipa-icf.c (sort_congruence_class_groups_by_decl_uid):
      	Use proper casting.
      
      From-SVN: r275969
      Martin Liska committed
    • aarch64: Implement -moutline-atomics · 3950b229
      	* config/aarch64/aarch64.opt (-moutline-atomics): New.
      	* config/aarch64/aarch64.c (aarch64_atomic_ool_func): New.
      	(aarch64_ool_cas_names, aarch64_ool_swp_names): New.
      	(aarch64_ool_ldadd_names, aarch64_ool_ldset_names): New.
      	(aarch64_ool_ldclr_names, aarch64_ool_ldeor_names): New.
      	(aarch64_expand_compare_and_swap): Honor TARGET_OUTLINE_ATOMICS.
      	* config/aarch64/atomics.md (atomic_exchange<ALLI>): Likewise.
      	(atomic_<atomic_op><ALLI>): Likewise.
      	(atomic_fetch_<atomic_op><ALLI>): Likewise.
      	(atomic_<atomic_op>_fetch<ALLI>): Likewise.
      	* doc/invoke.texi: Document -moutline-atomics.
      testsuite/
      	* gcc.target/aarch64/atomic-op-acq_rel.c: Use -mno-outline-atomics.
      	* gcc.target/aarch64/atomic-comp-swap-release-acquire.c: Likewise.
      	* gcc.target/aarch64/atomic-op-acquire.c: Likewise.
      	* gcc.target/aarch64/atomic-op-char.c: Likewise.
      	* gcc.target/aarch64/atomic-op-consume.c: Likewise.
      	* gcc.target/aarch64/atomic-op-imm.c: Likewise.
      	* gcc.target/aarch64/atomic-op-int.c: Likewise.
      	* gcc.target/aarch64/atomic-op-long.c: Likewise.
      	* gcc.target/aarch64/atomic-op-relaxed.c: Likewise.
      	* gcc.target/aarch64/atomic-op-release.c: Likewise.
      	* gcc.target/aarch64/atomic-op-seq_cst.c: Likewise.
      	* gcc.target/aarch64/atomic-op-short.c: Likewise.
      	* gcc.target/aarch64/atomic_cmp_exchange_zero_reg_1.c: Likewise.
      	* gcc.target/aarch64/atomic_cmp_exchange_zero_strong_1.c: Likewise.
      	* gcc.target/aarch64/sync-comp-swap.c: Likewise.
      	* gcc.target/aarch64/sync-op-acquire.c: Likewise.
      	* gcc.target/aarch64/sync-op-full.c: Likewise.
      
      From-SVN: r275968
      Richard Henderson committed
    • aarch64: Add out-of-line functions for LSE atomics · 33befddc
      This is the libgcc part of the interface -- providing the functions.
      Rationale is provided at the top of libgcc/config/aarch64/lse.S.
      
      	* config/aarch64/lse-init.c: New file.
      	* config/aarch64/lse.S: New file.
      	* config/aarch64/t-lse: New file.
      	* config.host: Add t-lse to all aarch64 tuples.
      
      From-SVN: r275967
      Richard Henderson committed
    • aarch64: Tidy aarch64_split_compare_and_swap · b7e560de
      With aarch64_track_speculation, we had extra code to do exactly what the
      !strong_zero_p path already did.  The rest is reducing code duplication.
      
      	* config/aarch64/aarch64 (aarch64_split_compare_and_swap): Disable
      	strong_zero_p for aarch64_track_speculation; unify some code paths;
      	use aarch64_gen_compare_reg instead of open-coding.
      
      From-SVN: r275966
      Richard Henderson committed