Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge trunk #2

Merged
merged 782 commits into from
Sep 5, 2018
Merged

merge trunk #2

merged 782 commits into from
Sep 5, 2018

Conversation

taskset
Copy link
Owner

@taskset taskset commented Sep 5, 2018

No description provided.

pmderodat and others added 30 commits August 21, 2018 14:47
If F is a function with a single defaulted parameter that returns an
access_to_array type, then F (I) may designate either the return type or
an indexing of the result of the call, after implicit dereferencing.  If
the component type C of the array type AR is accces AR this is ambiguous
in a context whose expected type is C. If F is parameterless the call is
not ambiguous.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Call): Resolve correctly a parameterless
	call that returns an access type whose designated type is the
	component type of an array, when the function has no defaulted
	parameters.

gcc/testsuite/

	* gnat.dg/access5.adb, gnat.dg/access5.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263726 138bc75d-0d04-0410-961f-82ee72b054a4
The implementation of these Ownership rules for safe pointers and
automatic memory management is still a prototype at an experimental
stage.

To activate the checks, the code should be compiled with the debug flag
-gnatdF and the flag -gnatd.F for setting the context for formal
verification of SPARK.

These changes do not affect compilation.

2018-08-21  Maroua Maalej  <maalej@adacore.com>

gcc/ada/

	* sem_spark.adb (Check_Call_Statement): Check global and formal
	parameter permissions at call sites.
	(Check_Callable_Body): Assume permissions on globals and
	parameters depending on their modes then analyse the body
	operations.
	(Check_Declaration): Consider both deep (including elementary
	access) object declarations and normal variables. First check
	whether the deep object is of Ownership Aspec True or not, then,
	depending on its initialization, assign the appropriate state.
	Check related to non access type variables deal with
	initialization value permissions.
	(Check_Expression): Check nodes used in the expression being
	analyzed.
	(Check_Globals): Call by Check_Call_Statement to perform the
	check on globals.
	(Check_List): Call Check_Node on each element of the list.
	(Check_Loop_Statement): Check the Iteration_Scheme and loop
	statements.
	(Check_Node): Main traversal procedure to check safe pointer usage.
	(Check_Package_Body): Check subprogram's body.
	(Check_Param_In): Take a formal and an actual parameter and
	Check the permission of every in-mode parameter.
	(Check_Param_Out): Take a formal and an actual parameter and
	check the state of out-mode and in out-mode parameters.
	(Check_Statement): Check statements other than procedure call.
	(Get_Perm, Get_Perm_Or_Tree, Get_Perm_Tree): Find out the state
	related to the given name.
	(Is_Deep): Return True if an object is of access type or has
	subfields of access type.
	(Perm_Error, Perm_Error_Subprogram_End): Add an error message
	whenever the found state on the given name is different from the
	one expected (in the statement being analyzed).
	(Process_Path): Given an operation and a current state, call
	Perm_Error if there is any mismatch.
	(Return_Declarations, Return_Globals, Return_The_Global): Check
	the state of a given name at the end of the subprogram. These
	procedures may change depending on how we shall finally deal
	with globals and the rhs state in a move operation.
	(Set_Perm_Extensions, Set_Perm_Prefixes_Borrow,
	Set_Perm_Prefixes, Setup_Globals, Setup_Parameter_Or_Global,
	Setup_Parameters): Set up the new states to the given node and
	up and down the tree after an operation.
	(Has_Ownership_Aspect_True): This function may disappear later
	when the Ownership Aspect will be implemented in the FE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263727 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-21  Bob Duff  <duff@adacore.com>

gcc/ada

	* einfo.ads, einfo.adb (Private_View, Shadow_Entities): Remove
	obsolete code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263728 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch13.adb (Build_Predicate_Functioss): Apply
	Reset_Quantified_Variables_Scope after predicate function has
	been analyzed, so that the scope can be reset on the generated
	loop statements that have replaced the quantified expressions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263729 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* exp_ch9.adb (Expand_N_Timed_Entry_Call,
	Expand_Conditional_Entry_Call): Use Reset_Scopes_Of to set
	properly the scope of all entities created in blocks generated
	by the expansion of these constructs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263730 138bc75d-0d04-0410-961f-82ee72b054a4
The conformance between an overriding protected operation with
progenitors and the overridden interface operation requires subtype
conformance; requiring equality of return types in the case of a
function is too restrictive and leads to spurious errors when the return
type is a generic actual.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch6.adb (Check_Synchronized_Overriding): The conformance
	between an overriding protected operation and the overridden
	abstract progenitor operation requires subtype conformance;
	requiring equality of return types in the case of a function is
	too restrictive and leads to spurious errors when the return
	type is a generic actual.

gcc/testsuite/

	* gnat.dg/prot6.adb, gnat.dg/prot6.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263731 138bc75d-0d04-0410-961f-82ee72b054a4
The compiler blows up writing the ALI file of a package that has a ghost
subprogram with an annotate contract.

2018-08-21  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* lib-writ.adb (Write_Unit_Information): Handle pragmas removed
	by the expander.

gcc/testsuite/

	* gnat.dg/spark2.adb, gnat.dg/spark2.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263732 138bc75d-0d04-0410-961f-82ee72b054a4
This patch ensures that with clauses that mention ignored Ghost units are
retained in the tree. The retention is necessary for several reasons:

   * The with clauses allow the new elaboration order mechanism to
     produce the same library edges regardless of whether the Ghost unit
     is checked or ignored. This ensures that the elaboration order
     remains consistent.

   * The with clauses allow the unnesting mechanism to properly
     recognize that all units have been examined for unnesing purposes.

No observable impact, no test needed.

2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* sem_ch10.adb: Remove the with and use clause for unit Ghost.
	(Analyze_With_Clause): Do not mark a with clause which mentions
	an ignored Ghost code for elimination.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263733 138bc75d-0d04-0410-961f-82ee72b054a4
This patch fixes a compiler abort on an expression function that is a
completion of a subprogram with preconditions. The problem is caused by
the presence of types in the precondition that are not frozen when the
subprogram body constructed for the expression function receives the
code that enforces the precondition. These types must be frozen before
the contract is expanded, so the freeze nodes for these types appear in
the proper scope. This is analogous to what is done with type references
that appear in the original expression of the expression function.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch6.adb: Remove Freeze_Expr_Types.
	* freeze.ads, freeze.adb (Freeze_Expr_Types): Moved from
	sem_ch6.adb, and extended to handle other expressions that may
	contain unfrozen types that must be frozen in their proper
	scopes.
	* contracts.adb (Analyze_Entry_Or_Subprogram_Contract): If the
	contract is for the generated body of an expression function
	that is a completion, traverse the expressions for pre- and
	postconditions to freeze all types before adding the contract
	code within the subprogram body.

gcc/testsuite/

	* gnat.dg/expr_func6.adb, gnat.dg/expr_func6.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263734 138bc75d-0d04-0410-961f-82ee72b054a4
This patch fixes a compiler abort on an expression function whose
expression includes tagged types that have not been frozen before the
generated body of the function is analyzed, even though that body is
inserted at the end of the current declarative part.

2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch6.adb (Analyze_Subprogram_Body_Helper, Mask_Type):
	Refine the handling of freezing types for expression functions
	that are not completions, when analyzing the generated body for
	the function: the body is inserted at the end of the enclosing
	declarative part, and its analysis may freeze types declared in
	the same scope that have not been frozen yet.

gcc/testsuite/

	* gnat.dg/expr_func7.adb, gnat.dg/expr_func7.ads: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263735 138bc75d-0d04-0410-961f-82ee72b054a4
VxLink is a helper tool used as a wrapper around g++/gcc to build
VxWorks DKM (Downloadable Kernel Modules).

Such DKM is a partially linked object that includes entry points for
constructors and destructors.

This tool thus uses g++ to generate an intermediate partially linked
object, retrieves the list of constructors and destructors in it and
produces a C file that lists those ctors/dtors in a way that is
understood be VxWorks kernel. It then links this file with the
intermediate object to produce a valid DKM.

2018-08-21  Jerome Lambourg  <lambourg@adacore.com>

gcc/ada/

	* vxlink-bind.adb, vxlink-bind.ads, vxlink-link.adb,
	vxlink-link.ads, vxlink-main.adb, vxlink.adb, vxlink.ads: Add a
	new tool vxlink to handle VxWorks constructors in DKMs.
	* gcc-interface/Makefile.in: add rules to build vxlink

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263736 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

	* checks.adb, contracts.adb, exp_aggr.adb, exp_attr.adb,
	exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_unst.adb,
	exp_util.adb, freeze.adb, gnatlink.adb, layout.adb,
	lib-writ.adb, lib-xref-spark_specific.adb, sem_ch13.adb,
	sem_ch3.adb, sem_ch6.adb, sem_res.adb, sem_util.adb, sinfo.ads,
	sprint.adb: Minor reformatting.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263737 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263738 138bc75d-0d04-0410-961f-82ee72b054a4
	* call.c (standard_conversion): Set check_narrowing.
	* typeck2.c (check_narrowing): Use CP_INTEGRAL_TYPE_P rather
	than comparing with INTEGER_TYPE.

	* g++.dg/concepts/pr67595.C: Add dg-warning.
	* g++.dg/cpp0x/Wnarrowing11.C: New test.
	* g++.dg/cpp0x/Wnarrowing12.C: New test.
	* g++.dg/cpp0x/rv-cast5.C: Add static_cast.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263739 138bc75d-0d04-0410-961f-82ee72b054a4
	* c.opt (Wpessimizing-move): New option.

	* typeck.c (decl_in_std_namespace_p): New.
	(is_std_move_p): New.
	(maybe_warn_pessimizing_move): New.
	(can_do_nrvo_p): New, factored out of ...
	(check_return_expr): ... here.  Warn about potentially harmful
	std::move in a return statement.

	* doc/invoke.texi: Document -Wpessimizing-move.

	* g++.dg/cpp0x/Wpessimizing-move1.C: New test.
	* g++.dg/cpp0x/Wpessimizing-move2.C: New test.
	* g++.dg/cpp0x/Wpessimizing-move3.C: New test.
	* g++.dg/cpp0x/Wpessimizing-move4.C: New test.
	* g++.dg/cpp1z/Wpessimizing-move1.C: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263741 138bc75d-0d04-0410-961f-82ee72b054a4
	* decl.c (check_static_variable_definition): Change to return void.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263742 138bc75d-0d04-0410-961f-82ee72b054a4
	* parser.c (cp_parser_lambda_introducer): Give error if a non-local
	lambda has a capture-default.

	* g++.dg/cpp0x/lambda/lambda-non-local.C: New test.
	* g++.dg/cpp0x/lambda/lambda-this10.C: Adjust dg-error.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263749 138bc75d-0d04-0410-961f-82ee72b054a4
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* gfortran.texi: Add description of asynchronous I/O.
	* trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
	as volatile.
	* trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
	st_wait_async and change argument spec from ".X" to ".w".
	(gfc_trans_wait): Pass ID argument via reference.

2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* gfortran.dg/f2003_inquire_1.f03: Add write statement.
	* gfortran.dg/f2003_io_1.f03: Add wait statement.

2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* Makefile.am: Add async.c to gfor_io_src.
	Add async.h to gfor_io_headers.
	* Makefile.in: Regenerated.
	* gfortran.map: Add _gfortran_st_wait_async.
	* io/async.c: New file.
	* io/async.h: New file.
	* io/close.c: Include async.h.
	(st_close): Call async_wait for an asynchronous unit.
	* io/file_pos.c (st_backspace): Likewise.
	(st_endfile): Likewise.
	(st_rewind): Likewise.
	(st_flush): Likewise.
	* io/inquire.c: Add handling for asynchronous PENDING
	and ID arguments.
	* io/io.h (st_parameter_dt): Add async bit.
	(st_parameter_wait): Correct.
	(gfc_unit): Add au pointer.
	(st_wait_async): Add prototype.
	(transfer_array_inner): Likewise.
	(st_write_done_worker): Likewise.
	* io/open.c: Include async.h.
	(new_unit): Initialize asynchronous unit.
	* io/transfer.c (async_opt): New struct.
	(wrap_scalar_transfer): New function.
	(transfer_integer): Call wrap_scalar_transfer to do the work.
	(transfer_real): Likewise.
	(transfer_real_write): Likewise.
	(transfer_character): Likewise.
	(transfer_character_wide): Likewise.
	(transfer_complex): Likewise.
	(transfer_array_inner): New function.
	(transfer_array): Call transfer_array_inner.
	(transfer_derived): Call wrap_scalar_transfer.
	(data_transfer_init): Check for asynchronous I/O.
	Perform a wait operation on any pending asynchronous I/O
	if the data transfer is synchronous. Copy PDT and enqueue
	thread for data transfer.
	(st_read_done_worker): New function.
	(st_read_done): Enqueue transfer or call st_read_done_worker.
	(st_write_done_worker): New function.
	(st_write_done): Enqueue transfer or call st_read_done_worker.
	(st_wait): Document as no-op for compatibility reasons.
	(st_wait_async): New function.
	* io/unit.c (insert_unit): Use macros LOCK, UNLOCK and TRYLOCK;
	add NOTE where necessary.
	(get_gfc_unit): Likewise.
	(init_units): Likewise.
	(close_unit_1): Likewise. Call async_close if asynchronous.
	(close_unit): Use macros LOCK and UNLOCK.
	(finish_last_advance_record): Likewise.
	(newunit_alloc): Likewise.
	* io/unix.c (find_file): Likewise.
	(flush_all_units_1): Likewise.
	(flush_all_units): Likewise.
	* libgfortran.h (generate_error_common): Add prototype.
	* runtime/error.c: Include io.h and async.h.
	(generate_error_common): New function.

2018-08-21  Nicolas Koenig  <koenigni@gcc.gnu.org>
	Thomas Koenig <tkoenig@gcc.gnu.org>

	PR fortran/25829
	* testsuite/libgomp.fortran/async_io_1.f90: New test.
	* testsuite/libgomp.fortran/async_io_2.f90: New test.
	* testsuite/libgomp.fortran/async_io_3.f90: New test.
	* testsuite/libgomp.fortran/async_io_4.f90: New test.
	* testsuite/libgomp.fortran/async_io_5.f90: New test.
	* testsuite/libgomp.fortran/async_io_6.f90: New test.
	* testsuite/libgomp.fortran/async_io_7.f90: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263750 138bc75d-0d04-0410-961f-82ee72b054a4
For floating point types, the question is what MAX(a, NaN) or MIN(a,
NaN) should return (where "a" is a normal number).  There are valid
usecases for returning either one, but the Fortran standard doesn't
specify which one should be chosen.  Also, there is no consensus among
other tested compilers.  In short, it's a mess.  So lets just do
whatever is fastest, which is using MAX_EXPR/MIN_EXPR which are not
defined to do anything in particular if one of the operands is a NaN.

gcc/fortran/ChangeLog:

2018-08-21  Janne Blomqvist  <jb@gcc.gnu.org>

	* trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use
	MAX_EXPR/MIN_EXPR unconditionally for real arguments.
	* gfortran.texi (Compiler Characteristics): Document MAX/MIN
	behavior wrt NaN.

gcc/testsuite/ChangeLog:

2018-08-21  Janne Blomqvist  <jb@gcc.gnu.org>

	* gfortran.dg/nan_1.f90: Remove tests that test MAX/MIN with NaNs.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263751 138bc75d-0d04-0410-961f-82ee72b054a4
	P0646R1 Improving the Return Value of Erase-Like Algorithms I
	* include/debug/forward_list (forward_list::__remove_return_type):
	Define typedef as size_type or void, according to __cplusplus value.
	(_GLIBCXX_FWDLIST_REMOVE_RETURN_TYPE_TAG): Define macro as abi-tag or
	empty, according to __cplusplus value.
	(_GLIBCXX20_ONLY): Define macro.
	(forward_list::remove, forward_list::unique): Use typedef and macro
	to change return type and add abi-tag for C++2a. Return number of
	removed elements for C++2a.
	(forward_list::remove_if<Pred>, forward_list::unique<BinPred>): Use
	typedef to change return type for C++2a. Return number of removed
	elements for C++2a.
	* include/debug/list (list::__remove_return_type): Define typedef as
	size_type or void, according to __cplusplus value.
	(_GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG): Define macro as abi-tag or
	empty, according to __cplusplus value.
	(_GLIBCXX20_ONLY): Define macro.
	(list::remove, list::unique): Use typedef and macro to change return
	type and add abi-tag for C++2a. Return number of removed elements for
	C++2a.
	(list::remove_if<Predicate>, list::unique<BinaryPredicate>): Use typedef
	to change return type for C++2a. Return number of removed elements for
	C++2a.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263752 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263758 138bc75d-0d04-0410-961f-82ee72b054a4
for  gcc/ChangeLog

	* tree-ssa-reassoc.c (is_reassociable_op): Fix cut&pasto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263759 138bc75d-0d04-0410-961f-82ee72b054a4
for  gcc/ChangeLog

	* config/rs6000/rs6000.c (SMALL_DATA_RELOC, SMALL_DATA_REG): Add
	a comment about how uses of r2 for .sdata2 come about.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263760 138bc75d-0d04-0410-961f-82ee72b054a4
	PR tree-optimization/86945
	* tree-cfg.c (generate_range_test): Use unsigned arithmetic.

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


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263761 138bc75d-0d04-0410-961f-82ee72b054a4
	PR tree-optimization/86988
	* tree-vrp.c (vrp_prop::check_mem_ref): Bail out on VLAs.

	* g++.dg/pr86988.C: New testcase.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263762 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/

	PR bootstrap/81033
	PR target/81733
	PR target/52795
	* gcc/dwarf2out.c (FUNC_SECOND_SECT_LABEL): New.
	(dwarf2out_switch_text_section): Generate a local label for the second
	function sub-section and apply it as the second FDE start label.
	* gcc/final.c (final_scan_insn_1): Emit second FDE label after the second
	sub-section start.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263763 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/

	* config/i386/i386.c (ix86_output_addr_diff_elt): Move the MACH-O
	specific test before the one for HAVE_AS_GOTOFF_IN_DATA.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263764 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/
	* config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Adjust to use the
	Darwin10-specific unwinder-shim.
	* config/darwin12.h (LINK_GCC_C_SEQUENCE_SPEC): Remove.
	* config/rs6000/darwin.h (DARWIN_CRT1_SPEC, DARWIN_DYLIB1_SPEC): 
	New to cater for Darwin10 Rosetta.

libgcc/
	* config/unwind-dw2-fde-darwin.c
	(_darwin10_Unwind_FindEnclosingFunction): move from here ...
	* config/darwin10-unwind-find-enc-func.c: … to here.
	* config/t-darwin: Build Darwin10 unwinder shim crt.
	* libgcc/config.host: Add the Darwin10 unwinder shim.




git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263765 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263766 138bc75d-0d04-0410-961f-82ee72b054a4
	PR libstdc++/77854
	* doc/xml/manual/status_cxx1998.xml: Document size_type and
	difference_type for containers.
	* doc/html/*: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263767 138bc75d-0d04-0410-961f-82ee72b054a4
marxin and others added 28 commits September 3, 2018 13:35
2018-09-03  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/87201
	* tree-switch-conversion.c (switch_decision_tree::balance_case_nodes):
	Fix parenthesis in an expression.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264058 138bc75d-0d04-0410-961f-82ee72b054a4
C++14 simplified the specification of the generic insert function
templates to be equivalent to calling emplace (or emplace_hint).
Defining them in terms of emplace takes care of the problems described
in PR 78595, ensuring a single conversion to value_type is done at the
right time.

	PR libstdc++/78595
	* include/bits/stl_map.h (map::insert(_Pair&&))
	(map::insert(const_iterator, _Pair&&)): Do emplace instead of insert.
	* include/bits/stl_multimap.h (multimap::insert(_Pair&&))
	(multimap::insert(const_iterator, _Pair&&)): Likewise.
	* include/bits/unordered_map.h (unordered_map::insert(_Pair&&))
	(unordered_map::insert(const_iterator, _Pair&&))
	(unordered_multimap::insert(_Pair&&))
	(unordered_multimap::insert(const_iterator, _Pair&&)): Likewise.
	* testsuite/23_containers/map/modifiers/insert/78595.cc: New test.
	* testsuite/23_containers/multimap/modifiers/insert/78595.cc: New test.
	* testsuite/23_containers/unordered_map/modifiers/78595.cc: New test.
	* testsuite/23_containers/unordered_multimap/modifiers/78595.cc: New
	test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264059 138bc75d-0d04-0410-961f-82ee72b054a4
Since C++11 range insertion and construction of maps and sets from a
pair of iterators only requires that the iterator's value_type is
convertible to the container's value_type (previously it had to be the
same).

This fixes the implementation to meet that relaxed requirement, by
defining a pair of overloads that either insert or emplace, depending on
the iterator's value_type. Instead of adding yet another overload of
_M_insert_unique and _M_insert_equal, the overloads taking iterators are
renamed to _M_insert_range_unique and _M_insert_range_equal.

	PR libstdc++/87194
	* include/bits/stl_map.h
	(map::map(initializer_list<value_type>, const Compare&, const Alloc&))
	(map::map(initializer_list<value_type>, const Alloc&))
	(map::map(InputIterator, InputIterator, const Alloc&))
	(map::map(InputIterator, InputIterator))
	(map::map(InputIterator, InputIterator, const Compare&, const Alloc&))
	(map::insert(InputIterator, InputIterator)):
	Call _M_insert_range_unique instead of _M_insert_unique.
	* include/bits/stl_multimap.h
	(multimap::multimap(initializer_list<value_type>, const C&, const A&))
	(multimap::multimap(initializer_list<value_type>, const A&))
	(multimap::multimap(InputIterator, InputIterator, const A&))
	(multimap::multimap(InputIterator, InputIterator))
	(multimap::multimap(InputIterator, InputIterator, const C&, const A&))
	(multimap::insert(InputIterator, InputIterator)): Call
	_M_insert_range_equal instead of _M_insert_equal.
	* include/bits/stl_multiset.h
	(multiset::multiset(InputIterator, InputIterator))
	(multiset::multiset(InputIterator, InputIterator, const C&, const A&))
	(multiset::multiset(initializer_list<value_type>, const C&, const A&))
	(multiset::multiset(initializer_list<value_type>, const A&))
	(multiset::multiset(InputIterator, InputIterator, const A&))
	(multiset::insert(InputIterator, InputIterator)): Call
	_M_insert_range_equal instead of _M_insert_equal.
	* include/bits/stl_set.h
	(set::set(InputIterator, InputIterator))
	(set::set(InputIterator, InputIterator, const Compare&, const Alloc&))
	(set::set(initializer_list<value_type>, const Compare&, const Alloc&))
	(set::set(initializer_list<value_type>, const Alloc&))
	(set::set(InputIterator, InputIterator, const Alloc&))
	(set::insert(InputIterator, InputIterator)):
	Call _M_insert_range_unique instead of _M_insert_unique.
	* include/bits/stl_tree.h
	[__cplusplus >= 201103L] (_Rb_tree::__same_value_type): New alias
	template for SFINAE constraints.
	[__cplusplus >= 201103L] (_Rb_tree::_M_insert_range_unique): Pair of
	constrained overloads that either insert or emplace, depending on
	iterator's value_type.
	[__cplusplus >= 201103L] (_Rb_tree::_M_insert_range_equal): Likewise.
	[__cplusplus < 201103L] (_Rb_tree::_M_insert_range_unique)
	(_Rb_tree::_M_insert_range_equal): New functions replacing range
	versions of _M_insert_unique and _M_insert_equal.
	(_Rb_tree::_M_insert_unique(_InputIterator, _InputIterator))
	(_Rb_tree::_M_insert_equal(_InputIterator, _InputIterator)): Remove.
	* testsuite/23_containers/map/modifiers/insert/87194.cc: New test.
	* testsuite/23_containers/multimap/modifiers/insert/87194.cc: New test.
	* testsuite/23_containers/multiset/modifiers/insert/87194.cc: New test.
	* testsuite/23_containers/set/modifiers/insert/87194.cc: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264060 138bc75d-0d04-0410-961f-82ee72b054a4
The pointer argument to allocator_traits::construct and
allocator_traits::destroy should be a raw pointer, not the allocator's
pointer type. _Temporary_value::_M_ptr was returning the wrong type.

	* include/bits/stl_vector.h (vector::_Temporary_value::_M_ptr):
	Return raw pointer not allocator's pointer type.
	(vector::_Temporary_value::_M_val): Use _M_ptr.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264061 138bc75d-0d04-0410-961f-82ee72b054a4
	PR tree-optimization/87200
	* tree-ssa-sccvn.c (vn_nary_build_or_lookup_1): Valueize a
	simplify result.

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


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264062 138bc75d-0d04-0410-961f-82ee72b054a4
Split the long double testing into a separate file, so that we can XFAIL
targets where the long double precision doesn't meet the expected
tolerances. The float and double tests are still expefted to PASS for
all targets.

	PR libstdc++/78179
	* testsuite/26_numerics/headers/cmath/hypot-long-double.cc: New test
	that runs the long double part of hypot.cc.
	* testsuite/26_numerics/headers/cmath/hypot.cc: Disable long double
	tests unless TEST_HYPOT_LONG_DOUBLE is defined.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264063 138bc75d-0d04-0410-961f-82ee72b054a4
Our md files refer to {l,st}xsd%U<n>x, but no {l,st}xsdux insns exist.
This patch removes the update forms.  All these use  constraint "Z"
which does not allow update form, so there is no practical difference.


	* config/rs6000/rs6000.md (*mov<mode>_hardfloat32): Remove %U from the
	lxsdx and stxsdx alternatives.
	(*mov<mode>_hardfloat64): Ditto.
	* config/rs6000/vsx.md (*vsx_extract_<mode>_store): Ditto.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264064 138bc75d-0d04-0410-961f-82ee72b054a4
	* sort.cc (gcc_qsort) [CHECKING_P]: Call qsort_chk.
	* system.h (qsort): Always redirect to gcc_qsort.  Update comment.
	* vec.c (qsort_chk): Do not call gcc_qsort.  Update comment.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264065 138bc75d-0d04-0410-961f-82ee72b054a4
	* sort.cc (struct sort_ctx): New field 'nlim'.  Use it...
	(mergesort): ... here as maximum count for using netsort.
	(gcc_qsort): Set nlim to 3 if stable sort is requested.
	(gcc_stablesort): New.
	* system.h (gcc_stablesort): Declare.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264066 138bc75d-0d04-0410-961f-82ee72b054a4
	* tree-loop-distribution.c (offset_cmp): Convert to C-qsort-style
	tri-state comparator.
	(fuse_memset_builtins): Change std::stable_sort to gcc_stablesort.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264067 138bc75d-0d04-0410-961f-82ee72b054a4
	* bb-reorder.c (edge_order): Convert to C-qsort-style
	tri-state comparator.
	(reorder_basic_blocks_simple): Change std::stable_sort to gcc_stablesort.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264068 138bc75d-0d04-0410-961f-82ee72b054a4
	PR tree-optimization/87177
	* tree-ssa-sccvn.c (vuse_ssa_val): Revert previous change, keep
	cleanup.

	* gcc.dg/torture/pr87177.c: New testcase.
	* gcc.dg/torture/pr87177-2.c: Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264069 138bc75d-0d04-0410-961f-82ee72b054a4
	* simplify.c (gfc_simplify_modulo): Re-arrange code to test whether
	'P' is zero and issue an error if it is.
	* gfortran.dg/modulo_check: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264070 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264074 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264075 138bc75d-0d04-0410-961f-82ee72b054a4
	* doc/extend.texi (Long Long, Hex Floats): Document support for
	long long and hex floats in more recent versions of ISO C++.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264076 138bc75d-0d04-0410-961f-82ee72b054a4
	PR tree-optimization/87176
	* tree-ssa-sccvn.c (visit_phi): Remove redundant allsame
	variable.  When value-numbering a virtual PHI node make sure
	to not value-number to the backedge value.

	* gcc.dg/torture/pr87176.c: New testcase.
	* gcc.dg/torture/ssa-fre-1.c: Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264077 138bc75d-0d04-0410-961f-82ee72b054a4
	(extract_range_from_binary_expr_1): Do not call
	vrp_can_optimize_bit_op.
	* wide-int-range.cc (wide_int_range_can_optimize_bit_op): Make
	static.
	(wide_int_range_get_mask_and_bounds): New.
	(wide_int_range_optimize_bit_op): New.
	(wide_int_range_bit_ior): Call wide_int_range_optimize_bit_op.
	(wide_int_range_bit_and): Same.
	* wide-int-range.h (wide_int_range_can_optimize_bit_op): Remove.
	(wide_int_range_optimize_bit_op): New.
	(wide_int_range_get_mask_and_bounds): New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264078 138bc75d-0d04-0410-961f-82ee72b054a4
	PR tree-optimization/87211
	* tree-ssa-sccvn.c (visit_phi): When value-numbering to a
	backedge value we're supposed to treat as VARYING also number
	the PHI to VARYING in case it got a different value-number already.

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


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264079 138bc75d-0d04-0410-961f-82ee72b054a4
	* doc/invoke.texi (Option Summary): Add -Waligned-new.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264080 138bc75d-0d04-0410-961f-82ee72b054a4
	* doc/invoke.texi (Option Summary): Add whitespace.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264083 138bc75d-0d04-0410-961f-82ee72b054a4
2018-09-04  Martin Liska  <mliska@suse.cz>

	* genmatch.c (output_line_directive): Add new argument
	fnargs.
	(dt_simplify::gen_1): Encapsulate dump within __builtin_expect.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264084 138bc75d-0d04-0410-961f-82ee72b054a4
	* wide-int-range.h (wide_int_range_convert): New.
	* tree-vrp.c (extract_range_from_unary_expr): Abstract wide int
	code into wide_int_range_convert.
	(extract_range_into_wide_ints): Do not munge anti range constants
	into the entire domain.  Just return the range back.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264085 138bc75d-0d04-0410-961f-82ee72b054a4
	PR target/86744
	* gcc.target/i386/addr-sel-1.c: Don't xfail "b\\+1" scan.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264086 138bc75d-0d04-0410-961f-82ee72b054a4
NAND is ~(a1 & a2), but xtensa_expand_atomic does ~a1 & a2.
That fixes libatomic tests atomic-op-{1,2}.

gcc/
2018-09-04  Max Filippov  <jcmvbkbc@gmail.com>

	* config/xtensa/xtensa.c (xtensa_expand_atomic): Reorder AND and
	XOR operations in NAND case.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264087 138bc75d-0d04-0410-961f-82ee72b054a4
	* common/config/i386/i386-common.c (OPTION_MASK_ISA_XSAVEOPT_SET,
	OPTION_MASK_ISA_XSAVES_SET, OPTION_MASK_ISA_XSAVEC_SET): Use
	OPTION_MASK_ISA_XSAVE_SET instead of OPTION_MASK_ISA_XSAVE.
	(OPTION_MASK_ISA_XSAVE_UNSET): Add OPTION_MASK_ISA_XSAVES_UNSET
	and OPTION_MASK_ISA_XSAVEC_UNSET.

	* gcc.target/i386/pr87198.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264088 138bc75d-0d04-0410-961f-82ee72b054a4
r251028

commit cd557ff
Author: hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Aug 10 15:29:05 2017 +0000

    i386: Don't use frame pointer without stack access

    When there is no stack access, there is no need to use frame pointer
    even if -fno-omit-frame-pointer is used and caller's frame pointer is
    unchanged.

frame pointer may not be available even if -fno-omit-frame-pointer is
used.  When this happened, arg pointer may be eliminated by hard frame
pointer.  Since hard frame pointer is encoded with DW_OP_fbreg which
uses the DW_AT_frame_base attribute, not hard frame pointer directly,
we should allow hard frame pointer when generating DWARF info even if
frame pointer isn't used.

gcc/

	PR debug/86593
	* dwarf2out.c (based_loc_descr): Allow hard frame pointer even
	if frame pointer isn't used.
	(compute_frame_pointer_to_fb_displacement): Likewise.

gcc/testsuite/

	PR debug/86593
	* g++.dg/pr86593.C: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264096 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264100 138bc75d-0d04-0410-961f-82ee72b054a4
@taskset
Copy link
Owner Author

taskset commented Sep 5, 2018

pull request : trunk 20180905

@taskset taskset merged commit 198c106 into taskset:master Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants