1. 25 Nov, 2019 10 commits
    • DEC comparisons - allow Hollerith constants in comparisons. · 32bef8ff
      The -fdec option enables the use of Hollerith comparisons in comparisons
      with INTEGER, COMPLEX, REAL and CHARACTER expressions.
      
      	Mark Eggleston  <mark.eggleston@codethink.com>
      	Jim MacArthur  <jim.macarthur@codethink.co.uk>
      
      	* gfortran.texi: Update Hollerith constants support for character types
      	and use in comparisons.
      	* invoke.texi: Tidy up list of options. Update description of
      	-fdec-char-conversions.
      	* resolve.c (is_character_based): New.
      	(Convert_hollerith_to_character): New.  (convert_to_numeric): New.
      	(resolve_operator): If both sides are character based and -fdec is
      	enabled convert Hollerith to character. If an operand is Hollerith, the
      	other is numeric and -fdec is enabled convert to numeric.
      	(resolve_ordinary_assign): Add check for -fdec-char-conversions for
      	assignment of character literals.
      
      	Mark Eggleston <mark.eggleston@codethink.com>
      	Jim MacArthur <jim.macarthur@codethink.co.uk>
      
      	* gfortran.dg/dec-comparison-character_1.f90: New test.
      	* gfortran.dg/dec-comparison-character_2.f90: New test.
      	* gfortran.dg/dec-comparison-character_3.f90: New test.
      	* gfortran.dg/dec-comparison-complex_1.f90: New test.
      	* gfortran.dg/dec-comparison-complex_2.f90: New test.
      	* gfortran.dg/dec-comparison-complex_3.f90: New test.
      	* gfortran.dg/dec-comparison-int_1.f90: New test.
      	* gfortran.dg/dec-comparison-int_2.f90: New test.
      	* gfortran.dg/dec-comparison-int_3.f90: New test.
      	* gfortran.dg/dec-comparison-real_1.f90: New test.
      	* gfortran.dg/dec-comparison-real_2.f90: New test.
      	* gfortran.dg/dec-comparison-real_3.f90: New test.
      	* gfortran.dg/dec-comparison.f90: New test.
      
      
      Co-Authored-By: Jim MacArthur <jim.macarthur@codethink.co.uk>
      
      From-SVN: r278674
      Mark Eggleston committed
    • re PR ada/92575 (couple of suspicious assignments in expect.c) · ee499b40
      	PR ada/92575
      	* expect.c (__gnat_expect_poll [VMS, HPUX]): Fix typo.
      
      From-SVN: r278671
      Eric Botcazou committed
    • ipa: Prevent materialization of clones with removed bodies (PR 92109) · d0b1b67a
      2019-11-25  Martin Jambor  <mjambor@suse.cz>
      
      	PR ipa/92109
      	* cgraph.h (cgraph_node::remove_from_clone_tree): Declare.
      	* cgraphclones.c (cgraph_node::remove_from_clone_tree): New method.
      	(cgraph_materialize_clone): Move removel from clone tree to the
      	the new method and use it instead.
      	* ipa.c (symbol_table::remove_unreachable_nodes): When removing
      	bodies of clones, also remove it from the clone tree.
      
      From-SVN: r278670
      Martin Jambor committed
    • Make IPA-SRA follow comdat-local rules (PR 91956) · ed649cda
      2019-11-25  Martin Jambor  <mjambor@suse.cz>
      
      	PR ipa/91956
      	* ipa-sra.c (process_isra_node_results): Put the new node to the
      	same comdat group as the original node.
      
      	testsuite/
      	* g++.dg/ipa/pr91956.C: New test.
      
      From-SVN: r278669
      Martin Jambor committed
    • Build double32 / long-double32 multilibs if needed. · 5b01f1a5
      gcc/
      	Build double32 / long-double32 multilibs if needed.
      	PR target/92055
      	* config/avr/t-avr:
      	(HAVE_DOUBLE_MULTILIB, HAVE_LONG_DOUBLE_MULTILIB): Remove vars.
      	(HAVE_DOUBLE32, HAVE_LONG_DOUBLE32, WITH_LONG_DOUBLE)
      	(HAVE_DOUBLE64, HAVE_LONG_DOUBLE64, WITH_DOUBLE): Set from
      	tm_defines and pass to genmultilib.awk.
      	* config/avr/genmultilib.awk: Use these variables to add double32
      	and / or long-double32 multilib(s) as needed.
      	* config/avr/driver-avr.c (avr_double_lib): Adjust comment.
      
      From-SVN: r278668
      Georg-Johann Lay committed
    • cfgloop.h (get_loop_exit_edges): Add extra parameter denoting loop body, defaulted to NULL. · f10d2d85
      2019-11-25  Richard Biener  <rguenther@suse.de>
      
      	* cfgloop.h (get_loop_exit_edges): Add extra parameter denoting
      	loop body, defaulted to NULL.
      	(single_likely_exit): Add exit vector argument
      	* tree-ssa-loop-niter.h (loop_only_exit_p): Add loop body argument.
      	(number_of_iterations_exit): Likewise.
      	(number_of_iterations_exit_assumptions): Likewise.
      	* cfgloop.c (get_loop_exit_edges): Use passed in loop body
      	if not NULL.
      	* cfgloopanal.c (single_likely_exit): Use passed in exit vector.
      	* tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
      	Compute exit vector around call to single_likely_exit.
      	* tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_loop): Pass down
      	loop body to loop_only_exit_p.
      	* tree-ssa-loop-niter.c (loop_only_exit_p): Get loop body from
      	caller.
      	(number_of_iterations_exit_assumptions): Get loop body from caller
      	if not NULL.
      	(number_of_iterations_exit): Pass through new loop body arg.
      	(infer_loop_bounds_from_undefined): Get loop body from caller.
      	(estimate_numbers_of_iterations): Compute loop body once.
      
      From-SVN: r278667
      Richard Biener committed
    • cfganal.c (pre_and_rev_post_order_compute_fn): Use an auto_bb_flag instead of an… · 5a34952e
      cfganal.c (pre_and_rev_post_order_compute_fn): Use an auto_bb_flag instead of an sbitmap for visited handling.
      
      2019-11-25  Richard Biener  <rguenther@suse.de>
      
      	* cfganal.c (pre_and_rev_post_order_compute_fn): Use an
      	auto_bb_flag instead of an sbitmap for visited handling.
      
      From-SVN: r278666
      Richard Biener committed
    • [rs6000] Refactor FP vector comparison operators · bceb7181
      This is a subsequent patch to refactor the existing float point
      vector comparison operator supports.  The patch to fix PR92132
      supplemented vector float point comparison by exposing the names
      for unordered/ordered/uneq/ltgt and adding ungt/unge/unlt/unle/
      ne.  As Segher pointed out, some patterns can be refactored
      together.  The main link on this is:
      https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00452.html
      
      gcc/ChangeLog
      
      2019-11-25 Kewen Lin  <linkw@gcc.gnu.org>
      
          * config/rs6000/vector.md (vector_fp_comparison_simple): New code iterator.
          (vector_fp_comparison_complex): Likewise.
          (vector_<code><mode> for VEC_F and vector_fp_comparison_simple): New
          define_and_split.
          (vector_<code><mode> for VEC_F and vector_fp_comparison_complex): Likewise.
          (vector_lt<mode> for VEC_F): Refactor with vector_fp_comparison_simple.
          (vector_le<mode> for VEC_F): Likewise.
          (vector_unge<mode> for VEC_F): Likewise.
          (vector_unle<mode> for VEC_F): Likewise.
          (vector_ne<mode> for VEC_F): Likewise.
          (vector_ungt<mode> for VEC_F): Likewise.
          (vector_unlt<mode> for VEC_F): Likewise.
          (vector_ltgt<mode> for VEC_F): Refactor with vector_fp_comparison_complex.
          (vector_ordered<mode> for VEC_F): Likewise.
          (vector_uneq<mode> for VEC_F): Likewise.
          (vector_unordered<mode> for VEC_F): Likewise.
      
      From-SVN: r278665
      Kewen Lin committed
    • re PR libfortran/92100 (Formatted stream IO irreproducible read with binary data in file) · ee1bc59e
      2019-11-24  Jerry DeLisle  <jvdelisle@gcc.ngu.org>
      
      	PR fortran/92100
      	gfortran.dg/streamio_18.f90: New test.
      
      From-SVN: r278664
      Jerry DeLisle committed
    • Daily bump. · 8d6b4fe7
      From-SVN: r278663
      GCC Administrator committed
  2. 24 Nov, 2019 7 commits
  3. 23 Nov, 2019 10 commits
    • Fixed ChangeLog entry. · 042d210c
      From-SVN: r278648
      Thomas Koenig committed
    • Add test case for PR 92442. · 5cebf730
      2019-11-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR fortran/92442
      	* gfortran.dg/bounds_check_21.f90: New test.
      
      From-SVN: r278647
      Thomas Koenig committed
    • Convert inliner to new param infrastructure · 1e83bd70
      /bin/sh: :q: command not found
      This patch adds opt_for_fn for all cross module params used by inliner
      so they can be modified at function granuality.  With inlining almost always
      there are three functions to consider (callee and caller of the inlined edge
      and the outer function caller is inlined to).
      
      I always use the outer function params since that is how local parameters
      behave.  I hope it is kind of what is also expected in most case: it is better
      to inline agressively into -O3 compiled code rather than inline agressively -O3
      functions into their callers.
      
      New params infrastructure is nice.  One drawback is that is very hard to
      search for individual param uses since they all occupy global namespace.
      With C++ world we had chance to do something like params.param_flag_name
      or params::param_flag_name instead...
      
      Bootstrapped/regtested x86_64-linux, comitted.
      
      	* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT): Remove.
      	* doc/invoke.texi (max-inline-insns-single-O2,
      	inline-heuristics-hint-percent-O2, inline-min-speedup-O2,
      	early-inlining-insns-O2): Remove documentation.
      	* ipa-fnsummary.c (analyze_function_body,
      	compute_fn_summary): Use opt_for_fn when accessing parameters.
      	* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
      	inline_insns_auto, can_inline_edge_by_limits_p,
      	want_early_inline_function_p, big_speedup_p,
      	want_inline_small_function_p, want_inline_self_recursive_call_p,
      	recursive_inlining, compute_max_insns, inline_small_functions):
      	Likewise.
      	* opts.c (default_options): Add -O3 defaults for
      	OPT__param_early_inlining_insns_,
      	OPT__param_inline_heuristics_hint_percent_,
      	OPT__param_inline_min_speedup_, OPT__param_max_inline_insns_single_.
      	* params.opt (-param=early-inlining-insns-O2=,
      	-param=inline-heuristics-hint-percent-O2=,
      	-param=inline-min-speedup-O2=, -param=max-inline-insns-single-O2=
      	-param=early-inlining-insns=, -param=inline-heuristics-hint-percent=,
      	-param=inline-min-speedup=, -param=inline-unit-growth=,
      	-param=large-function-growth=, -param=large-stack-frame=,
      	-param=large-stack-frame-growth=, -param=large-unit-insns=,
      	-param=max-inline-insns-recursive=,
      	-param=max-inline-insns-recursive-auto=,
      	-param=max-inline-insns-single=,
      	-param=max-inline-insns-size=, -param=max-inline-insns-small=,
      	-param=max-inline-recursive-depth=,
      	-param=max-inline-recursive-depth-auto=,
      	-param=min-inline-recursive-probability=,
      	-param=partial-inlining-entry-probability=,
      	-param=uninlined-function-insns=, -param=uninlined-function-time=,
      	-param=uninlined-thunk-insns=, -param=uninlined-thunk-time=): Add
      	Optimization.
      
      	* g++.dg/tree-ssa/pr53844.C: Drop -O2 from param name.
      	* g++.dg/tree-ssa/pr61034.C: Likewise.
      	* g++.dg/tree-ssa/pr8781.C: Likewise.
      	* g++.dg/warn/Wstringop-truncation-1.C: Likewise.
      	* gcc.dg/ipa/pr63416.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-thread-12.c: Likewise.
      	* gcc.dg/vect/pr66142.c: Likewise.
      	* gcc.dg/winline-3.c: Likewise.
      	* gcc.target/powerpc/pr72804.c: Likewise.
      
      From-SVN: r278645
      Jan Hubicka committed
    • Convert inliner to function specific param infrastructure · 9340d345
      This patch adds opt_for_fn for all cross module params used by inliner
      so they can be modified at function granuality.  With inlining almost always
      there are three functions to consider (callee and caller of the inlined edge
      and the outer function caller is inlined to).
      
      I always use the outer function params since that is how local parameters
      behave.  I hope it is kind of what is also expected in most case: it is better
      to inline agressively into -O3 compiled code rather than inline agressively -O3
      functions into their callers.
      
      New params infrastructure is nice.  One drawback is that is very hard to
      search for individual param uses since they all occupy global namespace.
      With C++ world we had chance to do something like params.param_flag_name
      or params::param_flag_name instead...
      
      Bootstrapped/regtested x86_64-linux, comitted.
      
      	* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT): Remove.
      	* doc/invoke.texi (max-inline-insns-single-O2,
      	inline-heuristics-hint-percent-O2, inline-min-speedup-O2,
      	early-inlining-insns-O2): Remove documentation.
      	* ipa-fnsummary.c (analyze_function_body,
      	compute_fn_summary): Use opt_for_fn when accessing parameters.
      	* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
      	inline_insns_auto, can_inline_edge_by_limits_p,
      	want_early_inline_function_p, big_speedup_p,
      	want_inline_small_function_p, want_inline_self_recursive_call_p,
      	recursive_inlining, compute_max_insns, inline_small_functions):
      	Likewise.
      	* opts.c (default_options): Add -O3 defaults for
      	OPT__param_early_inlining_insns_,
      	OPT__param_inline_heuristics_hint_percent_,
      	OPT__param_inline_min_speedup_, OPT__param_max_inline_insns_single_.
      	* params.opt (-param=early-inlining-insns-O2=,
      	-param=inline-heuristics-hint-percent-O2=,
      	-param=inline-min-speedup-O2=, -param=max-inline-insns-single-O2=
      	-param=early-inlining-insns=, -param=inline-heuristics-hint-percent=,
      	-param=inline-min-speedup=, -param=inline-unit-growth=,
      	-param=large-function-growth=, -param=large-stack-frame=,
      	-param=large-stack-frame-growth=, -param=large-unit-insns=,
      	-param=max-inline-insns-recursive=,
      	-param=max-inline-insns-recursive-auto=,
      	-param=max-inline-insns-single=,
      	-param=max-inline-insns-size=, -param=max-inline-insns-small=,
      	-param=max-inline-recursive-depth=,
      	-param=max-inline-recursive-depth-auto=,
      	-param=min-inline-recursive-probability=,
      	-param=partial-inlining-entry-probability=,
      	-param=uninlined-function-insns=, -param=uninlined-function-time=,
      	-param=uninlined-thunk-insns=, -param=uninlined-thunk-time=): Add
      	Optimization.
      
      	* g++.dg/tree-ssa/pr53844.C: Drop -O2 from param name.
      	* g++.dg/tree-ssa/pr61034.C: Likewise.
      	* g++.dg/tree-ssa/pr8781.C: Likewise.
      	* g++.dg/warn/Wstringop-truncation-1.C: Likewise.
      	* gcc.dg/ipa/pr63416.c: Likewise.
      	* gcc.dg/tree-ssa/ssa-thread-12.c: Likewise.
      	* gcc.dg/vect/pr66142.c: Likewise.
      	* gcc.dg/winline-3.c: Likewise.
      	* gcc.target/powerpc/pr72804.c: Likewise.
      
      From-SVN: r278644
      Jan Hubicka committed
    • ipa-fnsummary.c: Fix comment typos. · 956d615d
      	* ipa-fnsummary.c: Fix comment typos.
      	* ipa-ref.h: Likewise.
      	* ipa-predicate.h: Likewise.
      	* ipa-split.c: Likewise.
      	* ipa-inline-analysis.c: Likewise.
      	* ipa-predicate.c: Likewise.
      	* ipa-devirt.c: Likewise.
      	* ipa-icf.h: Likewise.
      	* profile-count.c: Likewise.
      	* ipa-icf.c: Likewise.
      	(sem_function::equals_wpa): Fix typos in dump messages.
      	* ipa-icf-gimple.h: Fix comment typos.
      	* ipa-inline-transform.c: Likewise.
      	* ipa-polymorphic-call.c: Likewise.
      	* ipa-fnsummary.h: Likewise.
      	* ipa-inline.c: Likewise.
      	(dump_inline_stats): Fix typo in debug dump message.
      	* profile-count.h: Fix comment typos.
      
      From-SVN: r278643
      Jakub Jelinek committed
    • re PR inline-asm/92615 (ICE in extract_insn) · 8d0d7a63
      	PR target/92615
      	* config/i386/i386.c (ix86_md_asm_adjust): If dest_mode is
      	GET_MODE (dest), is not QImode, using ZERO_EXTEND and dest is not
      	register_operand, force x into register before storing it into dest.
      	Formatting fix.
      
      	* gcc.target/i386/pr92615.c: New test.
      
      From-SVN: r278642
      Jakub Jelinek committed
    • re PR middle-end/83859 (Please add new attribute which will establish relation… · 1fbf51cb
      re PR middle-end/83859 (Please add new attribute which will establish relation between parameters for buffer and its size)
      
      	PR middle-end/83859
      	* doc/extend.texi (attribute access): Fix a typo.
      
      	* c-attribs.c (append_access_attrs): Avoid buffer overflow.  Avoid
      	memory leak.  Use XNEWVEC macro.  Use auto_diagnostic_group to
      	group warning with inform together.
      	(handle_access_attribute): Formatting fix.
      
      From-SVN: r278641
      Jakub Jelinek committed
    • re PR rtl-optimization/92610 (ICE in calc_dfs_tree, at dominance.c:458 since r270940) · ba585b91
      	PR rtl-optimization/92610
      	* cse.c (rest_of_handle_cse2): Call cleanup_cfg (0) also if
      	cse_cfg_altered is set, even when tem is 0.
      	(rest_of_handle_cse_after_global_opts): Likewise.
      
      	* g++.dg/opt/pr92610.C: New test.
      
      From-SVN: r278640
      Jakub Jelinek committed
    • re PR c++/92365 (ice unexpected expression ‘int16_t()’ of kind cast_expr) · 41149aca
      PR c++/92365
      
      2019-11-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              PR c++/92365
              * name-lookup.c (check_local_shadow): Use can_convert_arg
              instead of can_convert.
      
      testsuite:
      2019-11-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>
      
              PR c++/92365
              * g++.dg/pr92365.C: New test.
      
      From-SVN: r278639
      Bernd Edlinger committed
    • Daily bump. · f34a05b0
      From-SVN: r278638
      GCC Administrator committed
  4. 22 Nov, 2019 13 commits
    • PR c++/88337 - P1327R1: Allow polymorphic typeid in constexpr. · 66acfb80
      Part of P1327R1 is to allow typeid with an operand of polymorphic type in
      constexpr.  I found that we pretty much support it already, the only tweak
      was to allow TYPEID_EXPR (only created in a template) in constexpr in C++20.
      
      	* constexpr.c (potential_constant_expression_1): Allow a typeid
      	expression whose operand is of polymorphic type in constexpr in
      	C++20.
      	* rtti.c (build_typeid): Remove obsolete FIXME comment.
      
      	* g++.dg/cpp2a/constexpr-typeid1.C: New test.
      	* g++.dg/cpp2a/constexpr-typeid2.C: New test.
      	* g++.dg/cpp2a/constexpr-typeid3.C: New test.
      	* g++.dg/cpp2a/constexpr-typeid4.C: New test.
      
      From-SVN: r278635
      Marek Polacek committed
    • re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node'… · bdaf8be1
      re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node' is not defined as a type)
      
      	PR c/90677
      	* c-common.h (identifier_global_tag): Declare.
      	* c-format.c (get_pointer_to_named_type): Renamed to ...
      	(get_named_type): ... this.  Use identifier_global_tag instead of
      	identifier_global_value, handle the return value being a TYPE_P.
      	(init_dynamic_diag_info): Adjust get_pointer_to_named_type callers
      	to call get_named_type instead.  Formatting fixes.
      c/
      	* c-decl.c (identifier_global_tag): Define.
      cp/
      	* cp-objcp-common.c (identifier_global_tag): Define.
      testsuite/
      	* c-c++-common/pr90677.c: New test.
      
      From-SVN: r278634
      Jakub Jelinek committed
    • re PR c++/92458 (Constraints do not work with precompiled headers) · df418f1d
      	PR c++/92458
      	* tree-hash-traits.h (tree_decl_hash, tree_ssa_name_hash,
      	tree_hash): Move to ...
      	* tree.h (tree_decl_hash, tree_ssa_name_hash, tree_hash): ... here.
      	(struct decl_tree_cache_traits, struct type_tree_cache_traits): New
      	types.
      	(decl_tree_cache_map, tree_tree_cache_map): New typedefs.
      
      	* init.c (nsdmi_inst): Change type to
      	decl_tree_cache_map * from tree_cache_map *.
      	* constraint.cc (decl_constraints): Likewise.
      	* decl.c (get_tuple_decomp_init): Likewise.
      	* pt.c (defarg_inst, explicit_specifier_map): Likewise.
      	(tsubst_default_argument, store_explicit_specifier): Use
      	decl_tree_cache_map::create_ggc rather than
      	tree_cache_map::create_ggc.
      	* cp-objcp-common.c (debug_type_map): Change type to
      	type_tree_cache_map * from tree_cache_map *.
      
      	* g++.dg/pch/pr92458.C: New test.
      	* g++.dg/pch/pr92458.Hs: New test.
      
      From-SVN: r278633
      Jakub Jelinek committed
    • [Darwin, X86, testsuite] Update tests for common section use. · 839e636a
      The tests amended here now have different code-gen with default
      options because, previously, the access were indirected per Darwin
      ABI for common accesses.  The revised code-gen does not match the
      expected scan-asms because Darwin defaults to fPIC.  For these tests,
      it seems that the best solution is to use '-mdynamic-no-pic' in the
      m32 case which makes the output similar to the ElF platform default.
      
      gcc/testsuite/ChangeLog:
      
      2019-11-22  Iain Sandoe  <iain@sandoe.co.uk>
      
      	* gcc.target/i386/pr27971.c: Use mdynamic-no-pic for m32 on
      	Darwin.
      	* gcc.target/i386/sse2-load-multi.c: Likewise.
      	* gcc.target/i386/sse2-store-multi.c: Likewise.
      
      From-SVN: r278631
      Iain Sandoe committed
    • [testsuite] Commit missed Changelog entry. · 037ec35a
      From-SVN: r278630
      Iain Sandoe committed
    • Implement P1902R1, Missing feature-test macros 2017-2019. · 761df906
      	* c-cppbuiltin.c (c_cpp_builtins): Bump __cpp_init_captures
      	and __cpp_generic_lambdas for -std=c++2a.  Define
      	__cpp_designated_initializers, __cpp_constexpr_in_decltype and
      	__cpp_consteval for -std=c++2a.  Remove a FIXME comment about
      	__cpp_concepts for -std=c++2a.
      
      	* g++.dg/cpp1z/feat-cxx1z.C: Only compile with -std=c++17.
      	* g++.dg/cpp2a/feat-cxx2a.C: Adjust for P1902R1 changes.
      	* g++.dg/cpp2a/desig15.C: New test.
      	* g++.dg/cpp2a/lambda-pack-init3.C: New test.
      	* g++.dg/cpp2a/lambda-generic6.C: New test.
      	* g++.dg/cpp2a/consteval15.C: New test.
      
      From-SVN: r278628
      Jakub Jelinek committed
    • re PR tree-optimization/92618 (error: type mismatch in binary expression in reassoc since r273490) · 204b0beb
      	PR tree-optimization/92618
      	* tree-ssa-reassoc.c (v_info): Change from auto_vec to a struct
      	containing the auto_vec and a tree.
      	(undistribute_bitref_for_vector): Handle the case when element type
      	of vec is not the same as type of the BIT_FIELD_REF.  Formatting
      	fixes.
      
      	* gcc.c-torture/compile/pr92618.c: New test.
      	* gcc.c-torture/execute/pr92618.c: New test.
      
      From-SVN: r278626
      Jakub Jelinek committed
    • PR middle-end/83859 - attributes to associate pointer arguments and sizes · 54aa6b58
      gcc/ChangeLog:
      
      	PR middle-end/83859
      	* attribs.h (struct attr_access): New.
      	* attribs.c (decl_attributes): Add an informational note.
      	* builtins.c (check_access): Make extern.  Consistently set no-warning
      	after issuing a warning.  Handle calls through function pointers.  Set
      	no-warning.
      	* builtins.h (check_access): Declare.
      	* calls.c (rdwr_access_hash): New type.
      	(rdwr_map): Same.
      	(init_attr_rdwr_indices): New function.
      	(maybe_warn_rdwr_sizes): Same.
      	(initialize_argument_information): Call init_attr_rdwr_indices.
      	Call maybe_warn_rdwr_sizes.
      	(get_size_range): Avoid null argument.
      	* doc/extend.texi (attribute access): Document new attribute.
      
      gcc/c-family/ChangeLog:
      
      	PR middle-end/83859
      	* c-attribs.c (handle_access_attribute): New function.
      	(c_common_attribute_table): Add new attribute.
      	(get_argument_type): New function.
      	(append_access_attrs): New function.
      	(get_nonnull_operand): Rename...
      	(get_attribute_operand): ...to this.
      	* c-common.c (get_nonnull_operand): Rename...
      	(get_attribute_operand): ...to this.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/83859
      	* c-c++-common/attr-nonstring-8.c: Adjust text of expected warning.
      	* gcc.dg/Wstringop-overflow-23.c: New test.
      	* gcc.dg/Wstringop-overflow-24.c: New test.
      	* gcc.dg/attr-access-read-only.c: New test.
      	* gcc.dg/attr-access-read-write.c: New test.
      	* gcc.dg/attr-access-read-write-2.c: New test.
      	* gcc.dg/attr-access-write-only.c: New test.
      
      From-SVN: r278624
      Martin Sebor committed
    • PR middle-end/88226 - missing warning on fprintf, fputs, and puts with an unterminated array · b5338fb3
      gcc/ChangeLog:
      
      	PR middle-end/88226
      	* builtins.c (check_nul_terminated_array): New function.
      	(fold_builtin_0): Remove declaration.
      	(fold_builtin_1): Same.
      	(fold_builtin_2): Same.
      	(fold_builtin_3): Same.
      	(fold_builtin_strpbrk): Add argument.
      	(fold_builtin_strspn): Same.
      	(fold_builtin_strcspn): Same.
      	(expand_builtin_strcat): Call it.  Remove unused argument.
      	(expand_builtin_stpncpy): Same.
      	(expand_builtin_strncat): Same.
      	(expand_builtin_strncpy): Same.  Adjust indentation.
      	(expand_builtin_strcmp): Same.
      	(expand_builtin_strncmp): Same.
      	(expand_builtin_fork_or_exec): Same.
      	(expand_builtin): Handle more built-ins.
      	(fold_builtin_2): Add argument.
      	(fold_builtin_n): Make static.  Add argument.
      	(fold_call_expr): Pass new argument to fold_builtin_n and fold_builtin_2.
      	(fold_builtin_call_array): Pass new argument to fold_builtin_n.
      	(fold_builtin_strpbrk): Add argument.  Call check_nul_terminated_array.
      	(fold_call_stmt): Pass new argument to fold_builtin_n.
      	* builtins.h: Correct a comment.
      	* gimple-fold.c (gimple_fold_builtin_strchr): Call
      	check_nul_terminated_array.
      	* tree-ssa-strlen.c (handle_builtin_strlen): Call
      	check_nul_terminated_array.
      	(handle_builtin_strchr): Same.
      	(handle_builtin_string_cmp): Same.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/88226
      	* gcc.dg/Wstringop-overflow-22.c: New test.
      	* gcc.dg/tree-ssa/builtin-fprintf-warn-1.c: Remove xfails.
      
      From-SVN: r278623
      Martin Sebor committed
    • Limit LDS usage. · 86b0eb81
      2019-11-22  Andrew Stubbs  <ams@codesourcery.com>
      
      	gcc/
      	* config/gcn/gcn.c (OMP_LDS_SIZE): Define.
      	(ACC_LDS_SIZE): Define.
      	(OTHER_LDS_SIZE): Define.
      	(LDS_SIZE): Redefine using above.
      	(gcn_expand_prologue): Initialize m0 with LDS_SIZE-1.
      
      From-SVN: r278622
      Andrew Stubbs committed
    • PR tree-optimization/92501 - strncmp with constant unterminated arrays not folded · d2f8402a
      gcc/testsuite/ChangeLog:
      
      	PR tree-optimization/92501
      	* gcc.dg/strcmpopt_7.c: New test.
      
      gcc/ChangeLog:
      
      	PR tree-optimization/92501
      	* gimple-fold.c ((gimple_fold_builtin_string_compare): Let strncmp
      	handle unterminated arrays.  Rename local variables for clarity.
      
      From-SVN: r278621
      Martin Sebor committed
    • Use GFX9 granulated sgprs count correctly. · aa84ec84
      2019-11-22  Andrew Stubbs  <ams@codesourcery.com>
      
      	gcc/
      	* config/gcn/gcn.c (gcn_hsa_declare_function_name): Calculate
      	granulated_sgprs according to architecture.
      
      From-SVN: r278617
      Andrew Stubbs committed
    • Release memory-block-pool memory back to malloc. · 9fd052e7
      	* ggc-page.c (ggc_collect): Call memory_block_pool::trim.
      	* memory-block.cc (memory_block_pool::clear_free_list): Rename to ...
      	(memory_block_pool::reduce_free_list): ... this one.
      	(memory_block_pool::trim): New static function.
      	* memory-block.h (memory_block_pool::freelist_size): New constant
      	(memory_block_pool::clear_free_list): Rename to ...
      	(memory_block_pool::reduce_free_list): ... this one.
      	(memory_block_pool::trim): Declare.
      	
      	* lto.c (lto_wpa_write_files): Call memory_block_pool::trim.
      
      From-SVN: r278616
      Jan Hubicka committed