Commit Graph

172252 Commits

Author SHA1 Message Date
Gerald Pfeifer
19dc1c310f * doc/xml/gnu/gpl-3.0.xml: Switch www.gnu.org to https.
From-SVN: r277435
2019-10-25 05:19:50 +00:00
Edward Smith-Rowland
d57ebc3415 status_cxx2020.xml: Add rows and update status.
2019-09-09  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* doc/xml/manual/status_cxx2020.xml: Add rows and update status.

From-SVN: r277434
2019-10-25 01:44:10 +00:00
GCC Administrator
6bdddc9f5c Daily bump.
From-SVN: r277433
2019-10-25 00:17:12 +00:00
Jakub Jelinek
135df52cc3 gimplify.h (omp_construct_selector_matches): Declare.
* gimplify.h (omp_construct_selector_matches): Declare.
	* gimplify.c (struct gimplify_omp_ctx): Add code member.
	(gimplify_call_expr): Call omp_resolve_declare_variant and remap
	called function if needed for flag_openmp.
	(gimplify_scan_omp_clauses): Set ctx->code.
	(omp_construct_selector_matches): New function.
	* omp-general.h (omp_constructor_traits_to_codes,
	omp_context_selector_matches, omp_resolve_declare_variant): Declare.
	* omp-general.c (omp_constructor_traits_to_codes,
	omp_context_selector_matches, omp_resolve_declare_variant): New
	functions.
c-family/
	* c-common.h (c_omp_context_selector_matches): Remove.
	* c-omp.c (c_omp_context_selector_matches): Remove.
	* c-attribs.c (c_common_attribute_table): Add
	"omp declare target {host,nohost,block}" attributes.
c/
	* c-parser.c (c_finish_omp_declare_variant): Use
	omp_context_selector_matches instead of
	c_omp_context_selector_matches.
	* c-decl.c (c_decl_attributes): Add "omp declare target block"
	attribute in between declare target and end declare target
	pragmas.
cp/
	* decl2.c (cplus_decl_attributes): Add "omp declare target block"
	attribute in between declare target and end declare target
	pragmas.
testsuite/
	* c-c++-common/gomp/declare-variant-8.c: New test.

From-SVN: r277427
2019-10-25 00:29:09 +02:00
Jakub Jelinek
f8cb8bcde1 arc.c (hwloop_optimize): Add missing space in string literal.
* config/arc/arc.c (hwloop_optimize): Add missing space in string
	literal.
	* config/rx/rx.c (rx_print_operand): Likewise.
	* tree-vect-data-refs.c (vect_analyze_data_refs): Likewise.
	* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise.
	* ipa-sra.c (create_parameter_descriptors, process_scan_results):
	Likewise.
	* genemit.c (emit_c_code): Likewise.
	* plugin.c (try_init_one_plugin): Likewise.  Formatting fix.
cp/
	* call.c (convert_arg_to_ellipsis): Add missing space in string
	literal.

From-SVN: r277426
2019-10-25 00:27:10 +02:00
Jan Hubicka
ea3628bdeb symbols-summary.h (fast_function_summary<T *, [...]): Free m_vector.
* symbols-summary.h (fast_function_summary<T *, V>::release,
	fast_call_summary<T *, V>::release): Free m_vector.

From-SVN: r277425
2019-10-24 22:24:42 +00:00
Jan Hubicka
f658ad3002 cgraphunit.c (symbol_table::process_new_functions): Call ipa_free_size_summary.
* cgraphunit.c (symbol_table::process_new_functions): Call
	ipa_free_size_summary.
	* ipa-cp.c (ipcp_cloning_candidate_p): Update.
	(devirtualization_time_bonus): Update.
	(ipcp_propagate_stage): Update.
	* ipa-fnsummary.c (ipa_size_summaries): New.
	(ipa_fn_summary_alloc): Alloc size summary.
	(dump_ipa_call_summary): Update.
	(ipa_dump_fn_summary): Update.
	(analyze_function_body): Update.
	(compute_fn_summary): Likewise.
	(ipa_get_stack_frame_offset): New function.
	(inline_update_callee_summaries): Do not update frame offsets.
	(ipa_merge_fn_summary_after_inlining): Update frame offsets here;
	remove call and function summary.
	(ipa_update_overall_fn_summary): Update.
	(inline_read_section): Update.
	(ipa_fn_summary_write): Update.
	(ipa_free_fn_summary): Do not remove summaries.
	(ipa_free_size_summary): New.
	(release summary pass): Also run at WPA.
	* ipa-fnsummary.h (ipa_size_summary): Declare.
	(ipa_fn_summary): Remove size, self_size, stack_frame_offset,
	estimated_self_stack_size.
	(ipa_size_summary_t): New type.
	(ipa_size_summaries): Declare.
	(ipa_free_size_summary): Declare.
	(ipa_get_stack_frame_offset): Declare.
	* ipa-icf.c (sem_function::merge): Update.
	* ipa-inline-analysis.c (estimate_size_after_inlining): Update.
	(estimate_growth): Update.
	(growth_likely_positive): Update.
	(clone_inlined_nodes): Update.
	(inline_call): Update.
	* ipa-inline.c (caller_growth_limits): Update.
	(edge_badness): Update.
	(recursive_inlining): Update.
	(inline_small_functions): Update.
	(inline_to_all_callers_1): Update.
	* ipa-prop.h (ipa_edge_args_sum_t): Update comment.
	* lto-partition.c (add_symbol_to_partition_1): Update.
	(undo_parittion): Update.

From-SVN: r277424
2019-10-24 22:19:09 +00:00
Segher Boessenkool
90a158075a rs6000: Implement [u]avg<mode>3_ceil
We already had those in fact, just under other names.  Use the standard
names so that the vectorizer can use it.


	* config/rs6000/altivec.md (altivec_vavgu<VI_char>): Rename to...
	(uavg<mode>3_ceil): ... This.
	(altivec_vavgs<VI_char>): Rename to...
	(avg<mode>3_ceil): ... This.
	* config/rs6000/rs6000-builtin.def (VAVGUB, VAVGSB, VAVGUH, VAVGSH,
	VAVGUW, VAVGSW): Adjust.

From-SVN: r277421
2019-10-24 20:22:33 +02:00
Marek Polacek
1c95aee0a3 Add missing space to diagnostic in reshape_init_r.
* decl.c (reshape_init_r): Add missing space.

From-SVN: r277419
2019-10-24 17:22:27 +00:00
Nathan Sidwell
bdf1426df7 [C++ PATCH] Template parm index fix
https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01761.html
	* pt.c (reduce_template_parm_level): Attach the new TPI to the new
	DECL.
	(convert_generic_types_to_packs): Pass the copied type to
	reduce_template_parm_level.

From-SVN: r277416
2019-10-24 16:11:42 +00:00
Nathan Sidwell
84d2160d5d [dump] small source cleanup
https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01760.html
	* dumpfile.c (dump_begin): Reorder decls to use RAII.

From-SVN: r277415
2019-10-24 16:03:26 +00:00
Jonathan Wakely
75c6a925da Revert ABI changes to std::allocator in C++20
The recent C++20 changes to remove the std::allocator<void> explicit
specialization and the destructor in the std::allocator primary template
change the result of some is_trivially_xxx type traits. To avoid those
changes, this patch restores the explicit specialization and the
destructor.

In order to meet the C++20 requirements the std::allocator<void>
explicit specialization must provide the same interface as the primary
template (except for the unusable allocate and deallocate member
functions) and the destructor in the primary template must be constexpr.

	* include/bits/allocator.h (allocator<void>): Restore the explicit
	specialization for C++20, but make its API consistent with the primary
	template.
	(allocator::~allocator()): Restore the destructor for C++20, but make
	it constexpr.
	* testsuite/20_util/allocator/rebind_c++20.cc: Check allocator<void>.
	* testsuite/20_util/allocator/requirements/typedefs_c++20.cc: Likewise.
	* testsuite/20_util/allocator/void.cc: Check that constructors and
	destructors are trivial. Check for converting constructor in C++20.
	* testsuite/ext/malloc_allocator/variadic_construct.cc: Simplify
	dejagnu target selector.
	* testsuite/ext/new_allocator/variadic_construct.cc: Likewise.

From-SVN: r277410
2019-10-24 16:29:41 +01:00
Andreas Krebbel
bf037872d3 ipa-sra-19.c: Avoid unprototyped function
Power and IBM Z require a function prototype if a vector argument is
passed.  Complete the prototype of k to prevent errors from being
triggered on these platforms

gcc/testsuite/ChangeLog:

2019-10-24  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.dg/ipa/ipa-sra-19.c: Remove dg-skip-if. Add argument type to
	prototype of k.

From-SVN: r277409
2019-10-24 15:26:05 +00:00
Martin Liska
315d42482c Make gt_pch_nx unreachable in symbol-summary classes.
2019-10-24  Martin Liska  <mliska@suse.cz>

	* symbol-summary.h (gt_pch_nx): Mark all functions
	with gcc_unreachable as we do not expect to be called.

From-SVN: r277408
2019-10-24 15:08:30 +00:00
Andrew Sutton
79c05c2bc4 Finish moving constraint and logic functionality of out pt.c.
Also, reimplement and re-enable subsumption caching.

gcc/cp/
	* config-lang.in (gtfiles): Add logic.cc.
	* constraint.cc (atomic_constraints_identical_p): Add assertions.
	(hash_atomic_constraint): Likewise.
	(constraints_equivalent_p): New.
	(inchash::add_constraint): New.
	(iterative_hash_constraint): New.
	(decl_constraints): Moved from pt.c.
	(get_constraints): Likewise.
	(set_constraints): Likewise.
	(remove_constraints): Likewise.
	* cp-tree.h (CONSTR_P): New.
	(init_constraint_processing): Remove.
	(constraints_equivalent_p, iterative_hash_constraint): Declare.
	* decl.c (cxx_init_decl_processing): Don't initialize constraints.
	* logic.cc (subsumption_entry): Moved from pt.c.
	(subsumption_hasher): Likewise.
	(subsumption_cache): Likewise.
	(lookup_subsumption): Likewise.
	(save_subsumption): Likewise.
	(subsumes_constraints_nonnull): Use subsumption cache.
	* pt.c: Move aforementioned declarations out of this file.
	(init_constraint_processing): Remove.

From-SVN: r277407
2019-10-24 15:03:49 +00:00
Richard Biener
4352288a3d tree-vect-slp.c (vect_get_and_check_slp_defs): For reduction chains try harder with operand swapping and instead of putting a...
2019-10-24  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_get_and_check_slp_defs): For reduction
	chains try harder with operand swapping and instead of
	putting a shifted chain into the reduction operands put
	a repetition of the final reduction op there as if we'd
	reassociate the expression.

	* gcc.dg/vect/slp-reduc-10a.c: New testcase.
	* gcc.dg/vect/slp-reduc-10b.c: Likewise.
	* gcc.dg/vect/slp-reduc-10c.c: Likewise.
	* gcc.dg/vect/slp-reduc-10d.c: Likewise.
	* gcc.dg/vect/slp-reduc-10e.c: Likewise.

From-SVN: r277406
2019-10-24 15:01:45 +00:00
Jonathan Wakely
5ce55f3ff5 Simplify common case of use_future_t that uses std::allocator
There is no need to store and pass around the allocator object when it's
an instance of std::allocator. Define a partial specialization of
std::use_future_t and the corresponding completion token so that no
allocator is stored. Overload the completion handler constructor to not
expect an allocator to be stored.

	* include/experimental/executor (__use_future_ct, use_future_t):
	Define partial specializations for std::allocator.
	(__use_future_ch): Overload constructor for completion tokens using
	std::allocator.

From-SVN: r277404
2019-10-24 15:39:57 +01:00
Jan Hubicka
abebffc609 ipa-reference.c (ipa_reference_optimization_summary_d): Rename statics_not_read and statics_not_written to statics_read and...
* ipa-reference.c (ipa_reference_optimization_summary_d): Rename
	statics_not_read and statics_not_written to statics_read and
	statics_written respectively.
	(no_module_statics): New static var.
	(ipa_reference_get_not_read_global): Rename to ...
	(ipa_reference_get_read_global): ... this.
	(ipa_reference_get_not_written_global): Rename to ...
	(ipa_reference_get_written_global): ... this.
	(dump_static_vars_set_to_file): Dump no_module_statics.
	(copy_static_var_set): Add for propagation parameter.
	(ipa_init): Initialize no_module_statics.
	(ipa_ref_opt_summary_t::duplicate): Update.
	(ipa_ref_opt_summary_t::remove): Update.
	(propagate): Update.
	(write_node_summary_p): Look correctly for bitmap differences.
	(ipa_reference_write_optimization_summary): Update.
	(ipa_reference_read_optimization_summary): Update.
	* ipa-reference.h
	(ipa_reference_get_not_read_global): Rename to ...
	(ipa_reference_get_read_global): ... this.
	(ipa_reference_get_not_written_global): Rename to ...
	(ipa_reference_get_written_global): ... this.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Update.
	(call_may_clobber_ref_p_1): Update.

From-SVN: r277403
2019-10-24 14:19:40 +00:00
Jozef Lawrynowicz
39a6e72a9e MSP430: Remove unused msp430_hard_regno_nregs_*_padding functions
2019-10-24  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/msp430.c (msp430_hard_regno_nregs_has_padding): Remove
	and add comment.
	(msp430_hard_regno_nregs_with_padding): Remove.

From-SVN: r277395
2019-10-24 13:36:52 +00:00
Jozef Lawrynowicz
d8e4dc54a6 MSP430: Tweaks to generation of 430X instructions
gcc/ChangeLog:

2019-10-24  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/constraints.md: Allow post_inc for "Ya" constraint.
	* config/msp430/msp430.md (430x_shift_left): Use RLAM when the constant
	shift amount is between 1 and 4.
	(430x_arithmetic_shift_right): Use RRAM when the constant shift amount
	is between 1 and 4.

gcc/testsuite/ChangeLog:

2019-10-24  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* gcc.target/msp430/emulate-slli.c: Skip for -mcpu=msp430.
	Add shift by a constant 5 bits.
	Update scan-assembler directives.
	* gcc.target/msp430/emulate-srai.c: Likewise.
	* gcc.target/msp430/emulate-srli.c: Skip for -mcpu=msp430.

From-SVN: r277394
2019-10-24 13:34:54 +00:00
Richard Biener
e227594789 re PR tree-optimization/92205 (ICE in vect_get_vec_def_for_stmt_copy, at tree-vect-stmts.c:1688 since r277322)
2019-10-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92205
	* tree-vect-loop.c (vectorizable_reduction): Restrict
	search for alternate vectype_in to lane-reducing patterns
	we support.

	* gcc.dg/vect/pr92205.c: New testcase.

From-SVN: r277375
2019-10-24 12:11:27 +00:00
Richard Biener
ee80f0c6ba re PR tree-optimization/92203 (ICE in eliminate_stmt, at tree-ssa-sccvn.c:5492)
2019-10-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/92203
	* treee-ssa-sccvn.c (eliminate_dom_walker::eliminate_stmt):
	Skip eliminating conversion stmts inserted by insertion.

	* gcc.dg/torture/pr92203.c: New testcase.

From-SVN: r277374
2019-10-24 11:23:54 +00:00
Richard Biener
3574e5df1f re PR tree-optimization/65930 (Reduction with sign-change not handled)
2019-10-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/65930
	* gcc.dg/vect/vect-reduc-2short.c: Fix typo.

From-SVN: r277373
2019-10-24 10:23:52 +00:00
Richard Biener
0caece2c6b re PR tree-optimization/65930 (Reduction with sign-change not handled)
2019-10-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/65930
	* gcc.dg/vect/vect-reduc-2char-big-array.c: Adjust again.
	* gcc.dg/vect/vect-reduc-2char.c: Likewise.
	* gcc.dg/vect/vect-reduc-2short.c: Likewise.
	* gcc.dg/vect/vect-reduc-dot-s8b.c: Likewise.
	* gcc.dg/vect/vect-reduc-pattern-2c.c: Likewise.

From-SVN: r277372
2019-10-24 09:59:24 +00:00
Jonathan Wakely
02819d3919 PR libstdc++/88338 Implement P0898R3, C++20 concepts library
The implementation is already complete but this updates the docs and
adds tests for the feature test macro.

	* doc/xml/manual/status_cxx2020.xml: Update status.
	* doc/html/*: Regenerate.
	* testsuite/std/concepts/1.cc: New test.
	* testsuite/std/concepts/2.cc: New test.

From-SVN: r277371
2019-10-24 10:47:25 +01:00
Jonathan Wakely
bbf0495dd2 Define std::uniform_random_bit_generator concept for C++20
* include/bits/random.h (uniform_random_bit_generator): Define for
	C++20.
	* testsuite/26_numerics/random/concept.cc: New test.
	* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line.

From-SVN: r277369
2019-10-24 10:35:07 +01:00
Ilya Leoshkevich
8f4f98f617 S/390: Use UNSPEC_GET_TP for thread pointer loads
gcc/ChangeLog:

2019-10-24  Ilya Leoshkevich  <iii@linux.ibm.com>

	* config/s390/s390.c (s390_get_thread_pointer): Use
	gen_get_thread_pointer.
	(s390_expand_split_stack_prologue): Likewise.
	* config/s390/s390.md (UNSPEC_GET_TP): New UNSPEC.
	(*get_tp_31): New 31-bit splitter for UNSPEC_GET_TP.
	(*get_tp_64): New 64-bit splitter for UNSPEC_GET_TP.
	(get_thread_pointer<mode>): Use UNSPEC_GET_TP, use
	parameterized name.

gcc/testsuite/ChangeLog:

2019-10-24  Ilya Leoshkevich  <iii@linux.ibm.com>

	* gcc.target/s390/load-thread-pointer-once-2.c: New test.

From-SVN: r277368
2019-10-24 09:00:41 +00:00
Martin Liska
d136595df7 Fix another UBSAN in Fortran coarray.
2019-10-24  Martin Liska  <mliska@suse.cz>

	PR fortran/92174
	* array.c (gfc_resolve_array_spec): Break the loop
	for out of bounds index.
	* resolve.c (is_non_constant_shape_array): Likewise.

From-SVN: r277367
2019-10-24 08:49:02 +00:00
Richard Biener
0214d31a48 tree-vect-slp.c (vect_analyze_slp): When reduction group SLP discovery fails try to handle the reduction as part of...
2019-10-24  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_analyze_slp): When reduction group
	SLP discovery fails try to handle the reduction as part
	of SLP reduction discovery.

	* gcc.dg/vect/slp-reduc-9.c: New testcase.

From-SVN: r277366
2019-10-24 06:19:01 +00:00
Nathan Sidwell
5a7c450582 [C++ PATCH] 'std' identifier not needed
https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01707.html
	* cp-tree.c (CPTI_STD_IDENTIFIER): Delete.
	(std_identifier): Delete.
	(DECL_NAME_SPACE_STD_P): Compare against std_node.
	* decl.c (initialize_predefined_identifiers): 'std' is not needed.
	(cxx_init_decl_processing): Adjust creation of ::std.  Use
	{push,pop}_nested_namespace.
	(cxx_builtin_function): Use {push,pop}_nested_namespace.
	* except.c (init_exception_processing): Likewise.
	* rtti.c (init_rtti_processing): Likewise.

From-SVN: r277365
2019-10-24 00:59:57 +00:00
David Edelsohn
61d5466b6d pr70010.c: Add -Wno-psabi.
* gcc.target/powerpc/pr70010.c: Add -Wno-psabi.
        * gcc.target/powerpc/pr70010-[12].c: Require LTO.
        * gcc.target/powerpc/pr91275.c: Add -mcpu=power8.

From-SVN: r277363
2019-10-23 20:49:02 -04:00
GCC Administrator
15e0f08619 Daily bump.
From-SVN: r277362
2019-10-24 00:16:17 +00:00
Steven G. Kargl
e288c49dd0 2019-10-23 Steven G. Kargl <kargl@gcc.gnu.org>
dump-parse-tree.c (show_expr): Add dumping of BT_BOZ constants.

From-SVN: r277358
2019-10-23 23:29:25 +00:00
Michael Meissner
ca06b86c2f Rework how prefixed instruction length is calculated.
2019-10-23  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000-protos.h (rs6000_adjust_insn_length): New
	declaration.
	* config/rs6000/rs6000.c (rs6000_insn_cost): Use num_insns insn
	attribute if it exists, rather than the insn size.  If we use the
	insn size, adjust the size to remove the extra size that prefixed
	instructions take.
	(rs6000_adjust_insn_length): New function.
	* config/rs6000/rs6000.h (ADJUST_INSN_LENGTH): New target hook to
	update the instruction sized if prefixed instructions are used.
	* config/rs6000/rs6000.md (prefixed_length attribute): Delete.
	(non_prefixed_length attribute): Delete.
	(num_insns attribute): New insn attribute to return the number of
	instructions.
	(max_prefixed_insns attribute): New insn attribute to return the
	maximum number of prefixed instructions in an insn.
	(length attribute): Do not adjust for prefix instructions here,
	punt to ADJUST_INSN_LENGTH.
	(mov<mode>_64bit): Set max_prefixed_insns and num_insns.
	(movtd_64bit_nodm): Set max_prefixed_insns and num_insns.
	(mov<mode>_ppc64): Set max_prefixed_insns and num_insns.
	* config/rs6000/vsx.md: (vsx_mov<mode>_64bit): Set
	max_prefixed_insns and num_insns.

From-SVN: r277352
2019-10-23 20:53:08 +00:00
Jason Merrill
0998d2fd59 Implement P1286R2, Contra CWG1778
The C++11 requirement that an explicit exception-specification on a
defaulted function match the implicit one was found to be problematic for
std::atomic.  This paper, adopted in February, simply removes that
requirement: if an explicitly defaulted function has a different
exception-specification, that now works just like a user-written function:
either it isn't noexcept when it could be, or it is noexcept and will call
terminate if an exception is thrown.

	* method.c (defaulted_late_check): Don't check explicit
	exception-specification on defaulted function.
	(after_nsdmi_defaulted_late_checks): Remove.
	* parser.h (struct cp_unparsed_functions_entry): Remove classes.
	* parser.c (unparsed_classes): Remove.
	(push_unparsed_function_queues, cp_parser_class_specifier_1):
	Adjust.

From-SVN: r277351
2019-10-23 16:41:26 -04:00
Michael Meissner
cbb28ef153 Reformat some code; Add support for generating PLWA with offsets whose bottom 2 bits are non-zero.
2019-10-23  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.md (mov<mode>_64bit_dm): Reformat.
	(movtd_64bit_nodm): Reformat.
	(mov<mode>_32bit): Reformat.
	(mov<mode>_softfloat): Reformat.
	(FMOVE128_GPR splitter): Reformat.
	(DIFD splitter): Reformat.
	(TI2 splitter): Reformat.
	* config/rs6000/predicates.md (lwa_operand): If the bottom two
	bits of the offset for the memory address are non-zero, use PLWA
	if prefixed instructions are available.

From-SVN: r277349
2019-10-23 20:09:27 +00:00
Jan Hubicka
7c1bc95a48 lto-streamer-out.c (cmp_symbol_files): Watch for overflow.
* lto-streamer-out.c (cmp_symbol_files): Watch for overflow.

From-SVN: r277348
2019-10-23 20:01:25 +00:00
Jan Hubicka
45012be1f5 ipa-reference.c (varpool_removal_hook, [...]): Fix previous patch.
* ipa-reference.c (varpool_removal_hook, ipa_reference_c_finalize): Fix
	previous patch.

From-SVN: r277347
2019-10-23 19:03:42 +00:00
Jan Hubicka
ebad2eeed9 lto-streamer-out.c (output_constructor): Push CTORS_OUT timevar.
* lto-streamer-out.c (output_constructor): Push CTORS_OUT timevar.
	(cmp_symbol_files): New.
	(lto_output): Copy sections in file order.
	* lto-streamer.h (lto_file_decl_data): Add field order.
	* lto-common.c (lto_file_finalize): Add order attribute.
	(lto_create_files_from_ids): Pass order.
	(lto_file_read): UPdate call of lto_create_files_from_ids.

From-SVN: r277346
2019-10-23 18:22:40 +00:00
Jan Hubicka
b5b6485f1c ipa-reference.h (ipa_reference_var_uid): Move offline.
* ipa-reference.h (ipa_reference_var_uid): Move offline.
	* ipa-reference.c (reference_vars_map_t): new type.
	(ipa_reference_vars_map, ipa_reference_vars_uids): New static vars.
	(ipa_reference_var_uid): Implement.
	(varpool_node_hooks): New static var.
	(varpool_removal_hook): New function.
	(is_improper): Do not check bitmap for id==-1
	(get_static_name): Update.
	(ipa_init): Initialize new datastructures.
	(analyze_function): Do not recompute ids.
	(propagate): Free reference_vars_to_consider.
	(stream_out_bitmap): Update.
	(ipa_reference_read_optimization_summary): Update.

From-SVN: r277345
2019-10-23 18:18:31 +00:00
Qing Zhao
9fdaaf7772 re PR gcov-profile/91971 (Profile directory concatenated with object file path)
2019-10-23  qing zhao  <qing.zhao@oracle.com>

	PR gcov-profile/91971
	* coverage.c (coverage_init): Mangle the full path of filename when
	filename is a absolute path.

From-SVN: r277344
2019-10-23 18:12:39 +00:00
Jonathan Wakely
6d188e4fdd Make std::invoke usable in constant expressions
* include/std/functional (invoke): Add constexpr for C++20.
	* include/std/version (__cpp_lib_constexpr_invoke): Define.
	* testsuite/20_util/function_objects/invoke/constexpr.cc: New test.

From-SVN: r277343
2019-10-23 18:42:16 +01:00
Jonathan Wakely
85f2411493 PR c++/91369 Implement P0784R7 changes to allocation and construction
This patch is the first part of library support for constexpr
std::vector and std::string. This only includes the changes to
std::allocator, std::allocator_traits, std::construct_at,
std::destroy_at, std::destroy and std::destroy_n.

std::allocator::allocate and std::allocator::deallocate need to be
added so that they can be intercepted by the compiler during constant
evaluation. Outside of constant evaluation those new member functions
just forward to the existing implementation in the base class.

	PR c++/91369 Implement P0784R7 changes to allocation and construction
	* include/bits/alloc_traits.h: Include <bits/stl_construct.h>.
	(allocator_traits::_S_allocate, allocator_traits::_S_construct)
	(allocator_traits::_S_destroy, allocator_traits::_S_max_size)
	(allocator_traits::_S_select, allocator_traits::allocate)
	(allocator_traits::deallocate, allocator_traits::construct)
	(allocator_traits::destroy, allocator_traits::max_size)
	(allocator_traits::select_on_container_copy_construction)
	(allocator_traits<allocator<T>>): Add constexpr specifier for C++20.
	(allocator_traits<allocator<T>>::construct): Use construct_at.
	(allocator_traits<allocator<T>>::destroy): Use destroy_at.
	(__alloc_on_copy, __alloc_on_move, __alloc_on_swap): Add constexpr
	specifier.
	(_Destroy(ForwardIterator, ForwardIterator, Alloc&))
	(_Destroy(ForwardIterator, ForwardIterator, allocator<T>&)): Move here
	from <bits/stl_construct.h>.
	* include/bits/allocator.h (allocator::~allocator): Remove for C++20.
	(allocator::allocate, allocate::deallocate): Define for C++20 and up.
	(operator==, operator!=): Add constexpr specifier for C++20.
	* include/bits/stl_construct.h: Don't include <ext/alloc_traits.h>.
	(destroy_at): For C++20 add constexpr specifier and support for
	destroying arrays.
	(construct_at): Define new function for C++20.
	(_Construct): Return result of placement new-expression. For C++11 and
	up add constexpr. For C++20 dispatch to std::construct_at during
	constant evaluation.
	(_Destroy(pointer)): Add constexpr specifier. For C++20 dispatch to
	std::destroy_at during constant evaluation.
	(_Destroy_aux::__destroy, _Destroy_n_aux::__destroy_n): Add constexpr
	specifier for C++20.
	(_Destroy(ForwardIterator, ForwardIterator))
	(_Destroy(ForwardIterator, Size)): Likewise. Do not elide trivial
	destructors during constant evaluation.
	(destroy, destroy_n): Add constexpr specifier for C++20.
	(_Destroy(ForwardIterator, ForwardIterator, Alloc&))
	(_Destroy(ForwardIterator, ForwardIterator, allocator<T>&)): Move to
	<bits/alloc_traits.h>, to remove dependency on allocators.
	* include/bits/stl_uninitialized.h: Include <ext/alloc_traits.h>.
	Include <bits/stl_pair.h> instead of <utility>.
	* include/ext/alloc_traits.h: Always include <bits/alloc_traits.h>.
	(__alloc_traits::construct, __alloc_traits::destroy)
	(__alloc_traits::_S_select_on_copy, __alloc_traits::_S_on_swap): Add
	constexpr specifier.
	* include/ext/malloc_allocator.h  (operator==, operator!=): Add
	constexpr specifier for C++20.
	* include/ext/new_allocator.h (operator==, operator!=): Likewise.
	* testsuite/20_util/headers/memory/synopsis.cc: Add constexpr.
	* testsuite/20_util/scoped_allocator/69293_neg.cc: Ignore additional
	errors due to constexpr function called after failed static_assert.
	* testsuite/20_util/specialized_algorithms/construct_at/1.cc: New test.
	* testsuite/23_containers/vector/cons/destructible_debug_neg.cc:
	Ignore additional errors due to constexpr function called after failed
	static_assert.
	* testsuite/23_containers/vector/cons/destructible_neg.cc: Likewise.

From-SVN: r277342
2019-10-23 18:42:11 +01:00
Jozef Lawrynowicz
0744333e5a msp430-protos.h (msp430_has_hwmult): New.
2019-10-23  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/msp430-protos.h (msp430_has_hwmult): New.
	* config/msp430/msp430.c (msp430_no_hwmult): Remove.
	(msp430_has_hwmult): New.
	(msp430_output_labelref):
	s/msp430_hwmult_type != MSP430_HWMULT_NONE/msp430_has_hwmult ()/
	* config/msp430/msp430.md (mulhisi3): Likewise.
	(umulhisi3): Likewise.
	(mulsidi3): Likewise.
	(umulsidi3): Likewise.

From-SVN: r277341
2019-10-23 16:55:44 +00:00
Jozef Lawrynowicz
91c64455e8 lib2hw_mul.S: Fix wrong syntax in branch instruction.
2019-10-23  Jozef Lawrynowicz  <jozef.l@mittosystems.com>

	* config/msp430/lib2hw_mul.S: Fix wrong syntax in branch instruction.
	s/RESULT_LO/RESLO, s/RESULT_HI/RESHI, s/MPY_OP1/MPY, 
	s/MPY_OP1_S/MPYS, s/MAC_OP1/MAC, s/MPY_OP2/OP2, s/MAC_OP2/OP2.
	Define symbols for 32-bit and f5series hardware multiply
	register addresses.
	Replace hard-coded register addresses with symbols.
	Fix "_mspabi*" typo.
	Fix whitespace.
	* config/msp430/lib2mul.c: Add comment.

From-SVN: r277340
2019-10-23 16:52:47 +00:00
Jonathan Wakely
161c3bf9ee Replace C++14 feature used in C++11 test
* testsuite/20_util/bind/91371.cc: Fix test to compile as C++11.

From-SVN: r277339
2019-10-23 17:14:54 +01:00
Jonathan Wakely
30a761c4b5 Only qualify function as constexpr for C++14 and later
This helper function is not a valid constexpr function in C++11, so
should only be marked constexpr for C++14 and later.

	* include/debug/helper_functions.h (__valid_range): Change
	_GLIBCXX_CONSTEXPR to _GLIBCXX14_CONSTEXPR.

From-SVN: r277338
2019-10-23 17:14:50 +01:00
Jonathan Wakely
84a2f4b3a6 Qualify type names in <ext/throw_allocator.h>
* include/ext/throw_allocator.h (throw_allocator_base): Qualify
	size_t and ptrdiff_t.

From-SVN: r277337
2019-10-23 17:14:47 +01:00
Jonathan Wakely
ec541f1bc1 Adjust pb_ds extensions to use allocator_traits
These changes are largely useless, because most of them are simply
allowing 'reference' and 'const_reference' types to be obtained from an
allocator, and since C++11 allocators don't define reference types (they
just use plain lvalue references. Pretending to support C++98 allocators
with user-defined reference types is a waste of time (especially as
several of the pb_ds types appear to use a static allocator object which
means stateful allocators are not supported).

	* include/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp:
	Use detail::rebind_traits.
	* include/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp:
	Likewise.
	* include/ext/pb_ds/detail/bin_search_tree_/traits.hpp: Likewise.
	* include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Likewise.
	* include/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp: Likewise.
	* include/ext/pb_ds/detail/binary_heap_/entry_pred.hpp: Likewise.
	* include/ext/pb_ds/detail/binary_heap_/point_const_iterator.hpp:
	Likewise.
	* include/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp:
	Likewise.
	* include/ext/pb_ds/detail/branch_policy/branch_policy.hpp: Likewise.
	* include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp: Likewise.
	* include/ext/pb_ds/detail/cond_dealtor.hpp: Likewise.
	* include/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp (has_eq_fn): Likewise.
	* include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Likewise.
	* include/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp: Likewise.
	* include/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp: Likewise.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	left_child_next_sibling_heap_.hpp: Likewise.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp:
	Likewise.
	* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
	point_const_iterator.hpp: Likewise.
	* include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp: Likewise.
	* include/ext/pb_ds/detail/ov_tree_map_/
	constructors_destructor_fn_imps.hpp: Likewise.
	* include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp: Likewise.
	* include/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp: Likewise.
	* include/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp: Likewise.
	* include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp: Likewise.
	* include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp: Likewise.
	* include/ext/pb_ds/detail/rb_tree_map_/node.hpp: Likewise.
	* include/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp: Likewise.
	* include/ext/pb_ds/detail/splay_tree_/node.hpp: Likewise.
	* include/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp: Likewise.
	* include/ext/pb_ds/detail/trie_policy/sample_trie_access_traits.hpp:
	Likewise.
	* include/ext/pb_ds/detail/type_utils.hpp: Fix typo in comment.
	* include/ext/pb_ds/detail/types_traits.hpp (stored_value): Add
	bool parameter to control whether the hash value is stored.
	(select_base_type): New class template and partial specialization.
	(maybe_null_type): Likewise.
	(rebind_traits): New class template.
	(type_base): Remove four nearly identical specializations.
	(type_dispatch): Remove.
	(type_traits): Use select_base_type and maybe_null_type instead of
	type_base to control differences between specializations.
	* include/ext/pb_ds/list_update_policy.hpp: Use detail::rebind_traits.
	* include/ext/pb_ds/priority_queue.hpp: Likewise.
	* include/ext/pb_ds/tree_policy.hpp: Likewise.
	* include/ext/pb_ds/trie_policy.hpp: Likewise.

From-SVN: r277336
2019-10-23 17:14:43 +01:00
Jonathan Wakely
603aec6775 Adjust extension types to use allocator_traits
This makes these extensions work with types meeting the Cpp17Allocator
requirements as well as the C++98 Allocator requirements.

	* include/backward/hash_set (hash_set): Use __alloc_traits.
	* include/backward/hashtable.h (_Hashtable): Likewise.
	* include/ext/alloc_traits.h (__alloc_traits::allocate): Add overload
	taking a hint.
	* include/ext/extptr_allocator.h (_ExtPtr_allocator::allocate): Ignore
	hint.
	* include/ext/slist (_Slist_base): Use __alloc_traits.
	* include/tr1/hashtable.h (_Hashtable): Likewise.
	* include/tr1/regex (match_results): Use vector::const_reference
	instead of assuming the allocator defines it.
	* testsuite/backward/hash_map/23528.cc: Use allocator_traits in C++11.
	* testsuite/tr1/6_containers/unordered_map/capacity/29134-map.cc: Use
	__gnu_test::max_size.
	* testsuite/tr1/6_containers/unordered_multimap/capacity/
	29134-multimap.cc: Likewise.
	* testsuite/tr1/6_containers/unordered_multiset/capacity/
	29134-multiset.cc: Likewise.
	* testsuite/tr1/6_containers/unordered_set/capacity/29134-set.cc:
	Likewise.

From-SVN: r277335
2019-10-23 17:14:28 +01:00