Commit Graph

149231 Commits

Author SHA1 Message Date
Jakub Jelinek 75a434a91b dwarf2out.c (ranges_table): Change into vec<dw_ranges, va_gc> *.
* dwarf2out.c (ranges_table): Change into vec<dw_ranges, va_gc> *.
	(ranges_by_label): Change into vec<dw_ranges_by_label, va_gc> *.
	(ranges_table_allocated, ranges_table_in_use,
	ranges_by_label_allocated, ranges_by_label_in_use,
	RANGES_TABLE_INCREMENT): Removed.
	(add_ranges_num): Use vec_safe_push into ranges_table.
	(add_ranges_by_labels): Use vec_safe_push into ranges_by_label.
	(output_ranges): Adjust for ranges_table and ranges_by_label
	conversion from arrays to vec.
	(add_high_low_attributes, dwarf2out_finish): Adjust for range_table
	conversion from arrays to vec.
	(dwarf2out_c_finalize): Don't clear ranges_table_allocated,
	ranges_table_in_use, ranges_by_label_allocated and
	ranges_by_label_in_use.  Set ranges_by_label to NULL instead of 0.

From-SVN: r241409
2016-10-21 17:19:52 +02:00
Jakub Jelinek 8e6982f7aa dwarf2out.c (gen_variable_die): Emit DW_AT_const_expr attribute if needed.
* dwarf2out.c (gen_variable_die): Emit DW_AT_const_expr attribute
	if needed.  Re-add origin_die variable and its initialization.
cp/
	* cp-objcp-common.c (cp_decl_dwarf_attribute): Handle
	DW_AT_const_expr.
testsuite/
	* g++.dg/debug/dwarf2/constexpr-var-1.C: New test.

From-SVN: r241408
2016-10-21 17:11:48 +02:00
Jakub Jelinek f9faea3725 gimplify.c (gimplify_bind_expr): Handle oacc_declare_returns even for -fstack-reuse=none, or for volatile vars etc.
* gimplify.c (gimplify_bind_expr): Handle oacc_declare_returns
	even for -fstack-reuse=none, or for volatile vars etc.

From-SVN: r241407
2016-10-21 17:09:49 +02:00
David Malcolm e2ce9e83f7 Start adding selftests for print_rtx
gcc/ChangeLog:
	* print-rtl-function.c (flag_compact): Move extern decl to...
	* print-rtl.h (flag_compact): ...here.
	* rtl-tests.c (selftests::assert_rtl_dump_eq): New function.
	(ASSERT_RTL_DUMP_EQ): New macro.
	(selftest::test_dumping_regs): New function.
	(selftest::test_dumping_insns): New function.
	(selftest::test_uncond_jump): Add uses of ASSERT_RTL_DUMP_EQ on
	the insns.
	(selftest::rtl_tests_c_tests): Call the new test functions.

From-SVN: r241405
2016-10-21 13:52:53 +00:00
Jonathan Wakely 6652a944dc Use global operator new in std::make_exception_ptr
* libsupc++/exception_ptr.h (make_exception_ptr): Qualify new.
	* testsuite/18_support/exception_ptr/make_exception_ptr_2.cc: New
	test.

From-SVN: r241404
2016-10-21 14:21:09 +01:00
Paul Thomas de514d407e re PR fortran/69566 ([OOP] Failure of SELECT TYPE with unlimited polymorphic function result)
2016-10-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69566
	* resolve.c (fixup_array_ref): New function.
	(resolve_select_type): Gather up the rank and array reference,
	if any, from the selector. Fix up the 'associate name' and the
	'associate entities' as necessary.
	* trans-expr.c (gfc_conv_class_to_class): If the symbol backend
	decl is a FUNCTION_DECL, use the 'fake_result_decl' instead.

2016-10-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/69566
	* gfortran.dg/select_type_37.f03: New test.

From-SVN: r241403
2016-10-21 12:50:56 +00:00
Trevor Saunders dfe08bc4ef make tablejump_p return the label as a rtx_insn *
gcc/ChangeLog:

2016-10-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* cfgcleanup.c (merge_blocks_move_successor_nojumps): Adjust.
	(outgoing_edges_match): Likewise.
	(try_crossjump_to_edge): Likewise.
	* cfgrtl.c (try_redirect_by_replacing_jump): Likewise.
	(rtl_tidy_fallthru_edge): Likewise.
	* rtl.h (tablejump_p): Adjust prototype.
	* rtlanal.c (tablejump_p): Return the label as a rtx_insn *.

From-SVN: r241402
2016-10-21 12:33:01 +00:00
Trevor Saunders 04a121a757 make LABEL_REF_LABEL a rtx_insn *
While changing LABEL_REF_LABEL it might as well become an inline
function, so that its clearer what types are involved.  Unfortunately
because it is still possible to use XEXP and related macros on a
LABEL_REF rtx you can still set the field to be a non insn rtx.  The
other unfortunate thing is that the generators actually create LABEL_REF
rtx that refer to MATCH_x rtx, so there we actually need to use XEXP to
bypass the checking this patch adds.

gcc/ChangeLog:

2016-10-21  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* rtl.h (label_ref_label): New function.
	(set_label_ref_label): New function.
	(LABEL_REF_LABEL): Delete.
	* alias.c (rtx_equal_for_memref_p): Adjust.
	* cfgbuild.c (make_edges): Likewise.
	(purge_dead_tablejump_edges): Likewise.
	* cfgexpand.c (convert_debug_memory_address): Likewise.
	* cfgrtl.c (patch_jump_insn): Likewise.
	* combine.c (distribute_notes): Likewise.
	* cse.c (hash_rtx_cb): Likewise.
	(exp_equiv_p): Likewise.
	(fold_rtx): Likewise.
	(check_for_label_ref): Likewise.
	* cselib.c (rtx_equal_for_cselib_1): Likewise.
	(cselib_hash_rtx): Likewise.
	* emit-rtl.c (mark_label_nuses): Likewise.
	* explow.c (convert_memory_address_addr_space_1): Likewise.
	* final.c (output_asm_label): Likewise.
	(output_addr_const): Likewise.
	* gcse.c (add_label_notes): Likewise.
	* genconfig.c (walk_insn_part): Likewise.
	* genrecog.c (validate_pattern): Likewise.
	* ifcvt.c (cond_exec_get_condition): Likewise.
	(noce_emit_store_flag): Likewise.
	(noce_get_alt_condition): Likewise.
	(noce_get_condition): Likewise.
	* jump.c (maybe_propagate_label_ref): Likewise.
	(mark_jump_label_1): Likewise.
	(redirect_exp_1): Likewise.
	(rtx_renumbered_equal_p): Likewise.
	* lra-constraints.c (operands_match_p): Likewise.
	* print-rtl.c (print_value): Likewise.
	* reload.c (find_reloads): Likewise.
	* reload1.c (set_label_offsets): Likewise.
	* reorg.c (get_branch_condition): Likewise.
	* rtl-tests.c (test_uncond_jump): Likewise.
	* rtl.c (rtx_equal_p_cb): Likewise.
	(rtx_equal_p): Likewise.
	* rtlanal.c (reg_mentioned_p): Likewise.
	(rtx_referenced_p): Likewise.
	(get_condition): Likewise.
	* varasm.c (const_hash_1): Likewise.
	(compare_constant): Likewise.
	(const_rtx_hash_1): Likewise.
	(output_constant_pool_1): Likewise.

From-SVN: r241401
2016-10-21 12:32:56 +00:00
Senthil Kumar Selvaraj 1d64ceb057 Fix PR 71627 - unable to find a register to spill
Tweak find_valid_class_1 to consider a reg class if atleast one regno in
that class is ok.

Previously, even if no regno was in_hard_reg_set_p, the code goes ahead and
considers rclass as valid. bad was set only if a regno was in the reg
class *and* HARD_REGNO_MODE_OK was false - if both were false, bad wasn't
set and the reload got a wrong rclass. If that happened to be the best
one, this eventually lead to find_reg running out of registers to
spill, because the chosen rclass wouldn't have enough regs.

Also, it expected every regno in rclass to be valid for mode 
i.e., if any regno fails HARD_REGNO_MODE_OK, it rejected the rclass. The
comments in the original commit for find_valid_class_1 say atleast one
regno is ok. This was updated to say "class which contains only
registers" when in_hard_reg_set_p was introduced in place of just
TEST_HARD_REG_BIT.

This commit fixes both of the above problems by not breaking out of the loop
on first unavailable regno. Instead, it computes the rclass size consisting
of all regnos in that class valid for the current mode. 

If that computed size is zero, the rclass would be skipped, as it won't 
beat best_size. Otherwise, the computed size is used to choose the best 
rclass, instead of the static size from reg_class_size.

gcc/

2016-10-21  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	PR target/71627
	* reload.c (find_valid_class_1): Allow regclass if atleast one
	regno in regclass is ok. Compute and use rclass size based on
	actually available regnos for mode in rclass.

gcc/testsuite/

2016-10-21  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	PR target/71627
	* gcc.target/avr/pr71627.c: New test

From-SVN: r241400
2016-10-21 11:48:19 +00:00
Hartmut Penner 942c0db856 MAINTAINERS: Update email address
* MAINTAINERS: Update email address

Co-Authored-By: Ulrich Weigand <uweigand@de.ibm.com>

From-SVN: r241399
2016-10-21 11:29:52 +00:00
Eric Botcazou 1c0a88060b tree-ssa-loop-split.c: Remove trailing spaces.
* tree-ssa-loop-split.c: Remove trailing spaces.
	* match.pd: Likewise.

From-SVN: r241398
2016-10-21 09:17:47 +00:00
Eric Botcazou 8572922996 sparc-modes.def (CCV): New.
* config/sparc/sparc-modes.def (CCV): New.
	(CCXV): Likewise.
	* config/sparc/predicates.md (v_comparison_operator): New.
	(icc_comparison_operator): Add support for CCV/CCXV.
	(xcc_comparison_operator): Likewise.
	* config/sparc/sparc.c (output_cbranch): Likewise.
	(sparc_print_operand): Likewise.
	* config/sparc/sparc.md (UNSPEC_{ADD,SUB,NEG}V): New constants.
	(uaddvdi4): New expander.
	(addvdi4): Likewise.
	(uaddvdi4_sp32): New instruction.
	(addvdi4_sp32): Likewise.
	(uaddvsi4): New expander.
	(addvsi4): Likewise.
	(cmp_ccc_plus_sltu_set): New instruction.
	(cmp_ccv_plus): Likewise.
	(cmp_ccxv_plus): Likewise.
	(cmp_ccv_plus_set): Likewise.
	(cmp_ccxv_plus_set): Likewise.
	(cmp_ccv_plus_sltu_set): Likewise.
	(uaddvdi4): New expander.
	(subvdi4): Likewise.
	(usubdi4_sp32): New instruction.
	(subvdi4_sp32): Likewise.
	(usubvsi4): New expander.
	(subvsi4): Likewise.
	(cmpsi_minus_sltu_set): New instruction.
	(cmp_ccv_minus): Likewise.
	(cmp_ccxv_minus): Likewise.
	(cmp_ccv_minus_set): Likewise.
	(cmp_ccxv_minus_set): Likewise.
	(cmp_ccv_minus_sltu_set): Likewise.
	(unegvdi3): New expander.
	(negvdi3): Likewise.
	(unegdi3_sp32): New instruction.
	(negvdi3_sp32): Likewise.
	(unegvsi3): New expander.
	(negvsi3): Likewise.
	(cmp_ccc_neg_sltu_set): New instruction.
	(cmp_ccv_neg): Likewise.
	(cmp_ccxv_neg): Likewise.
	(cmp_ccv_neg_set): Likewise.
	(cmp_ccxv_neg_set): Likewise.
	(cmp_ccv_neg_sltu_set): Likewise.

From-SVN: r241397
2016-10-21 09:16:29 +00:00
Andre Vieira d17f2c3b49 pure-code.exp: Require arm_cortex_m effective target.
2016-10-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* gcc.target/arm/pure-code/pure-code.exp: Require arm_cortex_m
	effective target.

From-SVN: r241396
2016-10-21 08:53:27 +00:00
Kyrylo Tkachov 0d47cee6c4 [ree] PR rtl-optimization/78038: Handle global register dataflow definitions in ree
PR rtl-optimization/78038
	* ree.c (get_defs): Return NULL if a defining insn for REG cannot
	be deduced to set REG through the RTL structure.
	(make_defs_and_copies_lists): Return false on a failing get_defs call.

	* gcc.target/aarch64/pr78038.c: New test.

From-SVN: r241395
2016-10-21 07:55:30 +00:00
Richard Biener a20d03c882 re PR c++/78051 (error: dead STMT in EH table when using -O2)
2016-10-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/78051
	* tree-vrp.c (evrp_dom_walker::before_dom_children): Update stmt
	and mark replaced if folding did something.

	* g++.dg/torture/pr78051.C: New testcase.

From-SVN: r241394
2016-10-21 07:07:06 +00:00
David Edelsohn 924fae46b3 rs6000.c (rs6000_assemble_visibility): Swap "internal" and "protected" in visibility types.
* config/rs6000/rs6000.c (rs6000_assemble_visibility): Swap "internal"
and "protected" in visibility types.
(rs6000_xcoff_declare_function_name): Fix formatting.
(rs6000_xcoff_declare_object_name): Fix formatting.

From-SVN: r241393
2016-10-20 22:26:09 -04:00
Jerry DeLisle bdff7e518b transfer.c (finalize_transfer): Free format data in child procedures.
2016-10-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* io/transfer.c (finalize_transfer): Free format data in child
	procedures. (st_read_done, st_write_done): Don't free format
	hash table.

From-SVN: r241392
2016-10-21 01:41:03 +00:00
GCC Administrator 2b1c40345d Daily bump.
From-SVN: r241391
2016-10-21 00:16:14 +00:00
Steven G. Kargl 45f596d92c array.c (gfc_match_array_constructor): Remove set, but unused variable.
2016-10-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	* array.c (gfc_match_array_constructor): Remove set, but unused
	variable.

From-SVN: r241388
2016-10-20 23:55:19 +00:00
Uros Bizjak a7cfe83677 i386.c (ix86_fold_builtin): Handle IX86_BUILTIN_INFQ and IX86_BUILTIN_HUGE_VALQ here ...
* config/i386/i386.c (ix86_fold_builtin): Handle IX86_BUILTIN_INFQ
	and IX86_BUILTIN_HUGE_VALQ here ...
	(ix86_expand_builtin): ... not here.

From-SVN: r241387
2016-10-21 00:57:11 +02:00
Bernd Edlinger f3ecd50fd9 wdate-time.c: Restored test case.
2016-10-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-c++-common/wdate-time.c: Restored test case.
        * g++.dg/warn/Wconversion-real.C: Deleted empty file.

From-SVN: r241385
2016-10-20 19:39:19 +00:00
Ian Lance Taylor 6b752cfac4 runtime: rewrite interface code into Go
I started to copy the Go 1.7 interface code, but the gc and gccgo
    representations of interfaces are too different.  So instead I rewrote
    the gccgo interface code from C to Go.  The code is largely the same as
    it was, but the names are more like those used in the gc runtime.
    
    I also copied over the string comparison functions, and tweaked the
    compiler to use eqstring when comparing strings for equality.
    
    Reviewed-on: https://go-review.googlesource.com/31591

From-SVN: r241384
2016-10-20 18:51:35 +00:00
Jakub Jelinek fceabe505c * g++.dg/cpp1z/inline-var1.C (w): Initialize to 64 + 2.
From-SVN: r241383
2016-10-20 20:37:40 +02:00
Jakub Jelinek 8e92bce9f7 * doc/gty.texi (for_user): Use @item next to @findex.
From-SVN: r241382
2016-10-20 20:34:31 +02:00
Uros Bizjak f56ea76ecb re PR target/78037 (Incorrect code generated at optimization level -O2 for tzcnt and binary and)
PR target/78037
	* config/i386/bmiintrin.h (__tzcnt_u16): Call __builtin_ia32_tzcnt_u16.
	(__tzcnt_u32, _tzcnt_u32): Call __builtin_ia32_tzcnt_u32.
	(__tzcnt_u64, _tzcnt_u64): Call __builtin_ia32_tzcnt_u64.
	* config/i386/lzcntintrin.h (__lzcnt_u16): Call
	__builtin_ia32_lzcnt_u16.
	(__lzcnt_u32, _lzcnt_u32): Call __builtin_ia32_lzcnt_u32.
	(__lzcnt_u64, _lzcnt_u64): Call __builtin_ia32_lzcnt_u64.
	* config/i386/i386.md (UNSPEC_LZCNT, UNSPEC_TZCNT): New unspecs.
	(ctz<mode>2, *ctz<mode>2): Use SWI48 mode iterator.
	(bmi_tzcnt_<mode>): New expander.
	(*bmi_tzcnt_<mode>_falsedep_1): New define_insn_and_split pattern.
	(*bmi_tzcnt_<mode>_falsedep, *bmi_tzcnt_<mode>): New insn patterns.
	(clz<mode>2_lzcnt, *clz<mode>2_lzcnt): Use SWI48 mode iterator.
	(lzcnt_<mode>): New expander.
	(*lzcnt_<mode>_falsedep_1): New define_insn_and_split pattern.
	(*lzcnt_<mode>_falsedep, *lzcnt_<mode>): New insn patterns.
	* config/i386/i386-builtin-types.def (UINT_FTYPE_UINT): New.
	(UINT64_FTYPE_UINT64): New.
	* config/i386/i386-builtin.def (__builtin_clzs): Remove description.
	(__builtin_ia32_lzcnt_u16): New description.
	(__builtin_ia32_lzcnt_u32): Ditto.
	(__builtin_ia32_lzcnt_u64): Ditto.
	(__builtin_ctzs): Remove description.
	(__builtin_ia32_tzcnt_u16): New description.
	(__builtin_ia32_tzcnt_u32): Ditto.
	(__builtin_ia32_tzcnt_u64): Ditto.
	* config/i386/i386.c (ix86_expand_args_builtin): Handle
	UINT_FTYPE_UINT and UINT64_FTYPE_UINT64.

testsuite/ChangeLog:

	PR target/78037
	* gcc.target/i386/pr78037.c: New test.

From-SVN: r241381
2016-10-20 19:53:10 +02:00
Martin Liska 3e23d1bcc4 Do not fixup edges for a thunk in LTRANS (PR lto/78049)
PR lto/78049
	* lto-streamer-in.c (fixup_call_stmt_edges_1): Replace value
	comparison with STMT_UID_NOT_IN_RANGE.
	(fixup_call_stmt_edges): Do not fixup edges of a thunk in
	LTRANS.

From-SVN: r241380
2016-10-20 15:30:17 +00:00
Eric Botcazou 2c35bbe14a compare-elim.c (conforming_compare): Accept UNSPECs.
* compare-elim.c (conforming_compare): Accept UNSPECs.
	(find_comparison_dom_walker::before_dom_children): Deal with
	instructions both using and killing the flags register.
	(equivalent_reg_at_start): New function extracted from...
	(try_eliminate_compare): ...here.  Use it and add support for
	registers and UNSPECs as second operand of the compare.
	* config/visium/visium-modes.def (CCV): New.
	* config/visium/predicates.md (visium_v_comparison_operator): New.
	(visium_branch_operator): Deal with CCV mode.
	* config/visium/visium.c (visium_select_cc_mode): Likewise.
	(output_cbranch): Likewise.
	* config/visium/visium.md (UNSPEC_{ADD,SUB,NEG}V): New constants.
	(uaddv<mode>4): New expander.
	(addv<mode>4): Likewise.
	(add<mode>3_insn_set_carry): New instruction.
	(add<mode>3_insn_set_overflow): Likewise.
	(addsi3_insn_set_overflow): Likewise.
	(usubv<mode>4): New expander.
	(subv<mode>4): Likewise.
	(sub<mode>3_insn_set_carry): New instruction.
	(sub<mode>3_insn_set_overflow): Likewise.
	(subsi3_insn_set_overflow): Likewise.
	(unegv<mode>3): New expander.
	(negv<mode>3): Likewise.
	(neg<mode>2_insn_set_overflow): New instruction.
	(addv_tst<mode>): Likewise.
	(subv_tst<mode>): Likewise.
	(negv_tst<mode>): Likewise.
	(cbranch<mode>4_addv_insn): New splitter and instruction.
	(cbranch<mode>4_subv_insn): Likewise.
	(cbranch<mode>4_negv_insn): Likewise.

From-SVN: r241379
2016-10-20 14:38:43 +00:00
Richard Biener 40b8428e2e tree-ssa-alias.c (ptrs_compare_unequal): Remove code duplication.
2016-10-20  Richard Biener  <rguenther@suse.de>

	* tree-ssa-alias.c (ptrs_compare_unequal): Remove code duplication.
	Handle decls possibly not bound.
	* tree-ssa-structalias.c (get_constraint_for_ssa_var): Add
	nothing_id for decls that might not be bound if we are interested
	for the address.
	(get_constraint_for_component_ref): Deal with that.

From-SVN: r241378
2016-10-20 14:14:47 +00:00
Bernd Edlinger eff89e01b8 c-common.c (c_common_truthvalue_conversion): Fix the comment.
2016-10-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-common.c (c_common_truthvalue_conversion): Fix the comment.

From-SVN: r241377
2016-10-20 14:00:46 +00:00
Jason Merrill 24bc7bf417 * c-cppbuiltin.c (c_cpp_builtins): Update __cpp_concepts value.
From-SVN: r241376
2016-10-20 09:49:28 -04:00
Jason Merrill 916de0338d * g++.dg/cpp1z/aligned-new7.C: Fix for small MAX_STACK_ALIGNMENT targets.
From-SVN: r241375
2016-10-20 09:47:25 -04:00
Michael Matz 28df87300a loop splitting
(approved at https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00648.html )

	* common.opt (-fsplit-loops): New flag.
	* passes.def (pass_loop_split): Add.
	* opts.c (default_options_table): Add OPT_fsplit_loops entry at -O3.
	(enable_fdo_optimizations): Add loop splitting.
	* timevar.def (TV_LOOP_SPLIT): Add.
	* tree-pass.h (make_pass_loop_split): Declare.
	* tree-ssa-loop-manip.h (rewrite_into_loop_closed_ssa_1): Declare.
	* tree-ssa-loop-unswitch.c: Include tree-ssa-loop-manip.h,
	* tree-ssa-loop-split.c: New file.
	* Makefile.in (OBJS): Add tree-ssa-loop-split.o.
	* doc/invoke.texi (fsplit-loops): Document.
	* doc/passes.texi (Loop optimization): Add paragraph about loop
	splitting.

testsuite/
	* gcc.dg/loop-split.c: New test.
	* gcc.dg/tree-ssa/ifc-9.c: Update.
	* gcc.dg/tree-ssa/ifc-10.c: Update.

From-SVN: r241374
2016-10-20 12:18:32 +00:00
Jonathan Wakely a2e0054e1d Prepare shared_ptr for array support
* include/backward/auto_ptr.h (__shared_ptr(auto_ptr&&))
	(shared_ptr(auto_ptr&&)): Adjust template parameter lists.
	* include/bits/shared_ptr.h (__sp_compatible_with)
	(__sp_is_constructible): New helper traits for shared_ptr.
	(shared_ptr::_Convertible): Replace with _Constructible.
	(shared_ptr::_Constructible, shared_ptr::_Assignable): Forward checks
	to base class.
	(shared_ptr::shared_ptr, shared_ptr::operator=): Constrain template
	with _Constructible and _Assignable.
	(shared_ptr::shared_ptr(shared_ptr<_Tp1>, _Tp*)): Use element_type
	instead of _Tp.
	(operator<): Likewise.
	(operator>): Define in terms of operator<.
	(static_pointer_cast, const_pointer_cast, dynamic_pointer_cast): Use
	element_type instead of _Tp.
	(reinterpret_pointer_cast): Define for C++17.
	(weak_ptr::_Convertible): Replace with _Constructible.
	(weak_ptr::_Constructible, weak_ptr::_Assignable): Forward checks
	to base class.
	(weak_ptr::weak_ptr, weak_ptr::operator=): Constrain templates
	with _Constructible and _Assignable.
	* include/bits/shared_ptr_base.h (__shared_ptr::_Convertible): Replace
	with _Compatible.
	(__shared_ptr::_SafeConv): New constraint for incoming raw pointers.
	(__shared_ptr::_Compatible): New constraint for converting from
	other types of shared_ptr and weak_ptr.
	(__shared_ptr::_Assignable): Define in terms of _Compatible.
	(__shared_ptr::_UniqCompatible, __shared_ptr::_UniqAssignable): New
	constraints for converting from unique_ptr.
	(__shared_ptr::__shared_ptr, __shared_ptr::operator=): Constrain
	template with _SaveConf, _Compatible and _Assignable. Remove
	__glibcxx_function_requires concept checks. Add static assertion for
	deleter expression being well-formed.
	(__shared_ptr::__shared_ptr(__shared_ptr<_Tp1>, _Tp*))
	(__shared_ptr::operator*, __shared_ptr::operator->)
	(__shared_ptr::get, __shared_ptr::_M_ptr): Use element_type instead
	of _Tp.
	(operator<): Likewise.
	(operator>): Define in terms of operator<.
	(static_pointer_cast, const_pointer_cast, dynamic_pointer_cast): Use
	element_type instead of _Tp.
	(reinterpret_pointer_cast): Define for C++17.
	(weak_ptr::_Convertible): Replace with _Compatible.
	(weak_ptr::_Compatible, weak_ptr::_Assignable): New constraints for
	conversions from other types of weak_ptr and shared_ptr.
	(__weak_ptr::__weak_ptr, __weak_ptr::operator=): Constrain templates
	with _Constructible and _Assignable.
	(__weak_ptr::_M_ptr): Use element_type instead of _Tp.
	* testsuite/20_util/shared_ptr/assign/auto_ptr_neg.cc: Adjust
	dg-error pattern.
	* testsuite/20_util/shared_ptr/cons/auto_ptr.cc: Test conversions.
	* testsuite/20_util/shared_ptr/cons/unique_ptr.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/casts/reinterpret.cc: New test.

From-SVN: r241373
2016-10-20 13:07:45 +01:00
Ville Voutilainen f320e6a091 Do the operator= SFINAE in the return type for optional,
not in the template parameters.
* include/std/optional (operator=(_Up&&)): Move SFINAE
from template parameters to the return type.
(operator=(const optional<_Up>&)): Likewise.
(operator=(optional<_Up>&&)): Likewise.

From-SVN: r241372
2016-10-20 14:54:52 +03:00
Jonathan Wakely 88b3e63150 Tweak whitespace in std::allocator files
* include/bits/allocator.h: Remove trailing whitespace, tab-indent.
	* include/ext/new_allocator.h: Likewise.

From-SVN: r241371
2016-10-20 12:37:19 +01:00
Nicolas Roche 2e20345f13 Makefile (x86-64/Linux): Restore missing pairs.
* gcc-interface/Makefile (x86-64/Linux): Restore missing pairs.
	(x86/Darwin): Likewise.

From-SVN: r241369
2016-10-20 11:06:21 +00:00
Andre Vehreschild 40cc684dce class.c (gfc_build_class_symbol): Set the kind of _len to gfc_charlen_int_kind to catch changes of the charlen kind.
gcc/fortran/ChangeLog:

2016-10-20  Andre Vehreschild  <vehre@gcc.gnu.org>

	* class.c (gfc_build_class_symbol): Set the kind of _len to
	gfc_charlen_int_kind to catch changes of the charlen kind.

From-SVN: r241367
2016-10-20 12:50:27 +02:00
Richard Biener 6c1a9e41d9 pr35356-1.c: Update.
2016-10-20  Richard Biener  <rguenther@suse.de>

	* gcc.dg/graphite/pr35356-1.c: Update.

From-SVN: r241366
2016-10-20 10:43:39 +00:00
Jonathan Wakely 1d6360c85b PR78052 Define std::allocator<void>::{construct,destroy}
PR libstdc++/78052
	* include/bits/allocator.h (allocator<void>::construct)
	(allocator<void>::destroy): Define.
	* testsuite/20_util/allocator/void.cc: New test.

From-SVN: r241365
2016-10-20 11:13:10 +01:00
Jonathan Wakely 4f63d614fa Add more tests for enable_shared_from_this ambiguities
* testsuite/20_util/enable_shared_from_this/56383.cc: Add tests for
	additional ambiguous cases.

From-SVN: r241364
2016-10-20 11:13:04 +01:00
Richard Biener 775669c1eb cgraphunit.c (analyze_functions): Set node->definition to false to signal symbol removal to...
2016-10-20  Richard Biener  <rguenther@suse.de>

	* cgraphunit.c (analyze_functions): Set node->definition to
	false to signal symbol removal to debug_hooks->late_global_decl.
	* ipa.c (symbol_table::remove_unreachable_nodes): When not in
	WPA signal symbol removal to the debuginfo machinery.
	* dwarf2out.c (dwarf2out_late_global_decl): Instead of
	using early_finised to guard the we're called for symbol
	removal case look at the symtabs definition flag.
	(gen_variable_die): Remove redundant check.

From-SVN: r241363
2016-10-20 08:49:48 +00:00
Andreas Krebbel a65593a4b4 S/390: Add fallthrough comment in md file.
gcc/ChangeLog:

2016-10-20  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* config/s390/s390.md ("prefetch"): Add fallthrough comment.

From-SVN: r241362
2016-10-20 08:43:50 +00:00
Paolo Carlini a2923dbadb re PR c++/77446 (Suspicious "non-constant condition for static assertion" error)
2016-10-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/77446
	* g++.dg/cpp1y/pr77446.C: New.

From-SVN: r241361
2016-10-20 08:15:49 +00:00
Prathamesh Kulkarni 2066ef6ac8 re PR tree-optimization/53979 (((a ^ b) | a) not optimized to (a | b))
2016-10-20  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

	PR tree-optimization/53979
	* match.pd ((a ^ b) | a -> a | b): New pattern.

testsuite/
	* gcc.dg/pr53979-1.c: New test-case.
	* gcc.dg/pr53979-2.c: Likewise.

From-SVN: r241360
2016-10-20 07:55:28 +00:00
GCC Administrator d480863abb Daily bump.
From-SVN: r241359
2016-10-20 00:16:24 +00:00
John David Anglin 4c6d7494fc pa64-hpux-lib.h: New file.
libgcc/
	* config/pa/pa64-hpux-lib.h: New file.  
	(EH_FRAME_SECTION_NAME): Rename to __LIBGCC_EH_FRAME_SECTION_NAME__.
	(DTORS_SECTION_ASM_OP): Rename to __LIBGCC_DTORS_SECTION_ASM_OP__.
	* config.host (tm_file): Add pa/pa64-hpux-lib.h to tm_file on
	hppa*64*-*-hpux11*.
gcc/
	* config/pa/pa64-hpux.h (PA_INIT_FRAME_DUMMY_ASM_OP): Move to
	config/pa/pa64-hpux-lib.h.
	(PA_CRTBEGIN_HACK): Likewise.
	(DTOR_LIST_BEGIN): Likewise.

From-SVN: r241356
2016-10-19 22:52:21 +00:00
Bernd Edlinger 4c71237418 c-common.c (c_common_truthvalue_conversion): Warn only for signed integer shift ops in boolean context.
2016-10-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-common.c (c_common_truthvalue_conversion): Warn only for signed
        integer shift ops in boolean context.

testsuite:
2016-10-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * c-c++-common/Wint-in-bool-context-2.c: New test.

From-SVN: r241354
2016-10-19 21:00:39 +00:00
Jonathan Wakely f3070dab7a Make std::enable_shared_from_this cope with ambiguity
* include/backward/auto_ptr.h (__shared_ptr(auto_ptr&&)): Call
	_M_enable_shared_from_this_with instead of
	__enable_shared_from_this_helper.
	* include/bits/shared_ptr.h (__enable_shared_from_this_helper):
	Remove overload for std::enable_shared_from_this..
	(__enable_shared_from_this_base): Define friend function to select a
	std::enable_shared_from_this base class.
	* include/bits/shared_ptr_base.h (__enable_shared_from_this_helper):
	Remove all overloads.
	(__shared_ptr): Change all relevant constructors to call
	_M_enable_shared_from_this_with instead of
	__enable_shared_from_this_helper.
	(__shared_ptr::__efst_base_t, __shared_ptr::__has_efst_base): Helpers
	to detect accessible and unambiguous enable_shared_from_this bases.
	(__shared_ptr::_M_enable_shared_from_this_with): New function to
	replace __enable_shared_from_this_helper overloads.
	(__enable_shared_from_this_helper): Remove overload for
	std::__enable_shared_from_this.
	(__enable_shared_from_this_base): Define friend function to select a
	std::__enable_shared_from_this base class.
	* include/experimental/bits/shared_ptr.h (experimental::shared_ptr):
	Change relevant constructors to call _M_enable_shared_from_this_with.
	(experimental::shared_ptr::__efst_base_t)
	(experimental::shared_ptr::__has_efst_base): Helpers to detect
	accessible and unambiguous enable_shared_from_this bases.
	(experimental::shared_ptr::_M_enable_shared_from_this_with): Define.
	(experimental::__enable_shared_from_this_helper): Remove overload for
	std::experimental::enable_shared_from_this.
	(experimental::__expt_enable_shared_from_this_base): Define friend
	function to select a std::experimental::enable_shared_from_this base.
	* testsuite/experimental/memory/shared_ptr/cons/
	enable_shared_from_this.cc: New test.
	* testsuite/experimental/memory/shared_ptr/cons/unique_ptr_ctor.cc:
	Adjust expected behaviour for shared_ptr<A[]>.

From-SVN: r241353
2016-10-19 21:13:14 +01:00
Jerry DeLisle bdcf8e7c55 dtio_17.f90: Fix test.
2016-10-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* gfortran.dg/dtio_17.f90: Fix test.

From-SVN: r241352
2016-10-19 19:23:06 +00:00
Aldy Hernandez ec1748d461 Walloca-1.c: Adjust test for !lp64 targets.
* gcc.dg/Walloca-1.c: Adjust test for !lp64 targets.
	* gcc.dg/Walloca-2.c: Same.

From-SVN: r241351
2016-10-19 18:41:36 +00:00