Commit Graph

148476 Commits

Author SHA1 Message Date
Martin Liska
1822b732a3 Support movbe as a i386 target optimization node
* gcc.target/i386/movbe-4.c: New test.
	* config/i386/i386.c (ix86_valid_target_attribute_inner_p):
	Handle movbe.

From-SVN: r240394
2016-09-23 07:58:07 +00:00
Martin Liska
fab18cc4f7 Support crc32 as a i386 target optimization node
* config/i386/i386.c (ix86_valid_target_attribute_inner_p):
	Handle crc32.
	* gcc.target/i386/crc32-5.c: New test.

From-SVN: r240393
2016-09-23 07:57:07 +00:00
Martin Liska
e70f01b561 re PR target/71652 (ICE in in ix86_target_macros_internal, at config/i386/i386-c.c:187)
Fix PR target/71652

	PR target/71652
	* config/i386/i386.c (ix86_option_override_internal): Change
	signature and return false when there's an error related to
	arch string.
	(release_options_strings): New function.
	(ix86_valid_target_attribute_tree): Call the function.
	* gcc.target/i386/pr71652.c: New test.
	* gcc.target/i386/pr71652-2.c: New test.
	* gcc.target/i386/pr71652-3.c: New test.

From-SVN: r240392
2016-09-23 07:55:57 +00:00
Jakub Jelinek
f2e81d0585 gcc-dg.exp (process-message): Support relative line number notation - .+4 or .-1 etc.
* lib/gcc-dg.exp (process-message): Support relative line number
	notation - .+4 or .-1 etc.
	* gcc.dg/dg-test-1.c: New test.

From-SVN: r240391
2016-09-23 09:46:15 +02:00
Jakub Jelinek
aaa1b10f54 * hsa-gen.c (hsa_op_immed::hsa_op_immed Use CONSTRUCTOR_NELTS (...)
instead of vec_safe_length (CONSTRUCTOR_ELTS (...)).
	(gen_hsa_ctor_assignment): Likewise.
	* print-tree.c (print_node): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-sra.c (sra_modify_constructor_assign): Likewise.
	* expr.c (store_constructor): Likewise.
	* fold-const.c (operand_equal_p): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* hsa-brig.c (hsa_op_immed::emit_to_buffer): Likewise.
	* ipa-icf-gimple.c (func_checker::compare_operand): Likewise.
cp/
	* typeck2.c (process_init_constructor_record): Use
	CONSTRUCTOR_NELTS (...) instead of
	vec_safe_length (CONSTRUCTOR_ELTS (...)).
	* decl.c (reshape_init_r): Likewise.
	(check_initializer): Likewise.
ada/
	* gcc-interface/decl.c (gnat_to_gnu_entity): Use
	CONSTRUCTOR_NELTS (...) instead of
	vec_safe_length (CONSTRUCTOR_ELTS (...)).

From-SVN: r240390
2016-09-23 09:34:43 +02:00
Richard Biener
9500733cc6 hooks.h (hook_uint_uintp_false): Declare.
2016-09-23  Richard Biener  <rguenther@suse.de>

	* hooks.h (hook_uint_uintp_false): Declare.

From-SVN: r240389
2016-09-23 07:22:32 +00:00
Senthil Kumar Selvaraj
33989cfff5 Provide right LDD offset bound in avr_address_cost
This patch fixes cost computation in avr_address_cost - instead of the
hardcoded 61, it uses the already existing MAX_LD_OFFSET(mode) macro.

This showed up when investigating a code size regression in the ivopts
pass. That pass computes address_cost with and without an offset to
decide on the right induction variable candidate(s). The legitimate
address target hook returns false for offsets more than 63, so the
pass calls the TARGET_ADDRESS_COST hook with 62 as the offset.

The avr_address_cost hook returns 18 as the cost, and the ivopts pass 
concludes that the cost of address with *any* offset is 18, which is not 
true - the higher cost is incurred only with offsets bigger than MAX_LD_OFFSET. 
This in turn results in a suboptimal choice of induction variables in the
ivopts pass. The patch changes the hardcoded 61 to use the mode
specific MAX_LD_OFFSET instead.

Regression testing with just that fix showed one additional
compilation timeout. That turned out to be the same as
https://lists.nongnu.org/archive/html/avr-gcc-list/2014-03/msg00010.html
- the middle end takes too much time to decide on the best strategy to
multiply DImode values on a 64 bit host. This already causes timeouts
for a few builtin-arith-overflow-* tests (see
https://gcc.gnu.org/ml/gcc-testresults/2016-09/msg02018.html), so it
isn't really related to this fix. Just providing a cost estimate for
DImode mul fixes the timeout though, so the patch does that by scaling
SImode costs by 2 for DImode muls.

With both changes in, there are no regressions, and the
builtin-arith-overflow-* tests now PASS and don't timeout.

gcc/ChangeLog

2016-09-22  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* config/avr/avr.c (avr_rtx_costs_1): Handle DImode MULT.
	(avr_address_cost): Replace 61 with MAX_LD_OFFSET(mode).

From-SVN: r240388
2016-09-23 07:12:35 +00:00
Sebastian Huber
320c7be3ff [RTEMS] Always use atomic builtins for libstdc++
libstdc++-v3/
	* config/cpu/m68k/atomicity.h: Adjust comment.
	* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Honor
	explicit atomicity_dir setup via configure.host.
	* configure.host (rtems-*): Set atomicity_dir.
	* configure: Regenerate.

From-SVN: r240387
2016-09-23 06:58:00 +00:00
GCC Administrator
e9f1eeed6b Daily bump.
From-SVN: r240386
2016-09-23 00:16:16 +00:00
Martin Sebor
ed30d2a6f4 PR target/77676 - powerpc64 and powerpc64le stage2 bootstrap fail
gcc/testsuite/ChangeLog:

	PR target/77676
	* gcc.dg/tree-ssa/builtin-sprintf-1.c: Define and use wint_t.
	* gcc.dg/tree-ssa/builtin-sprintf-2.c: Fix typo.
	* gcc.dg/tree-ssa/builtin-sprintf-3.c: New test.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-5.c: New test.

gcc/ChangeLog:

	PR target/77676
	* gimple-ssa-sprintf.c (target_int_min, target_int_max): Use
	HOST_BITS_PER_WIDE_INT, make a static local variable auto.
	(target_int_min): Correct computation.
	(format_integer): Use long long as the argument for the ll length
	modifier.
	(format_floating): Use target_int_max().
	(get_string_length): Same.
	(format_string): Avoid setting the bounded flag for strings
	of unknown length.
	(try_substitute_return_value): Avoid setting range info when
	the result isn't bounded.
	* varasm.c (assemble_name): Increase buffer size.

From-SVN: r240383
2016-09-22 15:28:07 -06:00
Ian Lance Taylor
0cb904afbe compiler: compile runtime.getcaller{pc,sp} into builtin functions
The runtime functions runtime.getcallerpc and runtime.getcallersp are
    intended to be efficient ways to get the return and frame address of the
    caller (that is, the caller of runtime.getcallerpc).  In the C code that
    is implemented by simply using C macros:
    
    This patch essentially implements those macros in the Go code.
    
    It would be nice if we could just use //extern for this, but it doesn't
    work because the runtime code passes the right argument.  Of course we
    could change the runtime code, but these are common enough that I'd
    prefer to avoid the difference from the gc version of the runtime code.
    
    This patch corrects the existing declaration of __builtin_return_address
    to use uint32, rather than uint, for the parameter type.  The builtin
    functions take the C type "unsigned int", which for the targets we use
    corresponds to the Go type uint32.  Not that it should matter, really.
    
    Reviewed-on: https://go-review.googlesource.com/29653

From-SVN: r240382
2016-09-22 20:32:16 +00:00
Uros Bizjak
1c681c7bf7 ifcvt-1.c: Compile also for 64-bit i?86-*-* target.
* gcc.dg/ifcvt-1.c: Compile also for 64-bit i?86-*-* target.
	* gcc.dg/ifcvt-2.c: Ditto.
	* gcc.dg/zero_bits_compound-1.c: Ditto.
	* gcc.dg/zero_bits_compound-1.c: Ditto.
	* gcc.dg/pr40550.c: Simplify target selectors.
	Use dg-additional-options.
	* gcc.dg/pr47893.c: Ditto.
	* gcc.dg/pr68435.c: Compile also for i?86-*-* target.  Add -march=i686
	additional options for 32-bit x86 targets.
	* gcc.dg/pr70955.c: Move to ...
	* gcc.target/i386/pr70955.c: ... here.  Simplify target selector.

From-SVN: r240381
2016-09-22 20:11:19 +02:00
Paolo Carlini
67cf0a5391 re PR c++/61019 (ICE: incomplete type of class template as pseudo-destructor-name)
2016-09-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/61019
	* g++.dg/cpp0x/pr61019.C: New.

From-SVN: r240380
2016-09-22 17:11:33 +00:00
Andre Vieira
0ee70cc000 [ARM] Add support for -mpure-code option
gcc/ChangeLog:
2016-09-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Terry Guo  <terry.guo@arm.com>

    * target.def (elf_flags_numeric): New target hook.
    * targhooks.h (default_asm_elf_flags_numeric): New.
    * varasm.c (default_asm_elf_flags_numeric): New.
    (default_elf_asm_named_section): Use new target hook.
    * config/arm/arm.opt (mpure-code): New.
    * config/arm/arm.h (SECTION_ARM_PURECODE): New.
    * config/arm/arm.c (arm_asm_init_sections): Add section
    attribute to default text section if -mpure-code.
    (arm_option_check_internal): Diagnose use of option with
    non supported targets and/or options.
    (arm_asm_elf_flags_numeric): New.
    (arm_function_section): New.
    (arm_elf_section_type_flags): New.
    * config/arm/elf.h (JUMP_TABLES_IN_TEXT_SECTION): Disable
    for -mpure-code.
    * gcc/doc/texi (TARGET_ASM_ELF_FLAGS_NUMERIC): New.
    * gcc/doc/texi.in (TARGET_ASM_ELF_FLAGS_NUMERIC): Likewise.

gcc/testsuite/ChangeLog:
2016-09-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>
            Terry Guo  <terry.guo@arm.com>

    * gcc.target/arm/pure-code/ffunction-sections.c: New.
    * gcc.target/arm/pure-code/no-literal-pool.c: New.
    * gcc.target/arm/pure-code/pure-code.exp: New.

Co-Authored-By: Terry Guo <terry.guo@arm.com>

From-SVN: r240379
2016-09-22 17:02:47 +00:00
Ian Lance Taylor
31e9f857d5 gofrontend: add missing break in Builtin_call_expression::do_flatten
Reviewed-on: https://go-review.googlesource.com/29593

From-SVN: r240378
2016-09-22 17:02:04 +00:00
Uros Bizjak
43639d2c8f const-2b.c: Also compile for x86_64-*-*.
* gcc.dg/debug/dwarf2/const-2b.c: Also compile for x86_64-*-*.
	Remove SSE effective target requirement.

From-SVN: r240377
2016-09-22 18:23:20 +02:00
Tamar Christina
8de88f7f0e * MAINTAINERS (Write After Approval): Add myself.
From-SVN: r240375
2016-09-22 15:41:03 +00:00
Paolo Carlini
a608d15bed re PR c++/71979 (ICE with on C++ code with incorrect type in overloaded base class '=' operator: in build_base_path, at cp/class.c:304)
/cp
2016-09-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71979
	* class.c (build_base_path): Allow for lookup_base returning
	NULL_TREE.

/testsuite
2016-09-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/71979
	* g++.dg/cpp0x/pr71979.C: New.

From-SVN: r240373
2016-09-22 15:26:23 +00:00
Jan Hubicka
ed64a4e75f Revert accidental commit.
From-SVN: r240369
2016-09-22 15:20:43 +00:00
Jan Hubicka
d6da226a1e * regcprop.c (copyprop_hardreg_forward_1): Remove noop moves.
From-SVN: r240365
2016-09-22 14:34:09 +00:00
Jonathan Wakely
2dbe56bdfb Implement C++17 node extraction and insertion (P0083R5)
* doc/xml/manual/status_cxx2017.xml: Document status.
	* doc/html/*: Regenerate.
	* include/Makefile.am: Add bits/node_handle.h and reorder.
	* include/Makefile.in: Regenerate.
	* include/bits/hashtable.h (_Hashtable::node_type)
	(_Hashtable::insert_return_type, _Hashtable::_M_reinsert_node)
	(_Hashtable::_M_reinsert_node_multi, _Hashtable::extract)
	(_Hashtable::_M_merge_unique, _Hashtable::_M_merge_multi): Define.
	(_Hash_merge_helper): Define primary template.
	* include/bits/node_handle.h: New header.
	* include/bits/stl_map.h (map): Declare _Rb_tree_merge_helper as
	friend.
	(map::node_type, map::insert_return_type, map::extract, map::merge)
	(map::insert(node_type&&), map::insert(const_iterator, node_type&&)):
	Define new members.
	(_Rb_tree_merge_helper): Specialize for map.
	* include/bits/stl_multimap.h (multimap): Declare _Rb_tree_merge_helper
	as friend.
	(multimap::node_type, multimap::extract, multimap::merge)
	(multimap::insert(node_type&&))
	(multimap::insert(const_iterator, node_type&&)): Define.
	(_Rb_tree_merge_helper): Specialize for multimap.
	* include/bits/stl_multiset.h (multiset): Declare _Rb_tree_merge_helper
	as friend.
	(multiset::node_type, multiset::extract, multiset::merge)
	(multiset::insert(node_type&&))
	(multiset::insert(const_iterator, node_type&&)): Define.
	* include/bits/stl_set.h (set): Declare _Rb_tree_merge_helper as
	friend.
	(set::node_type, set::insert_return_type, set::extract, set::merge)
	(set::insert(node_type&&), set::insert(const_iterator, node_type&&)):
	Define.
	(_Rb_tree_merge_helper): Specialize for set.
	* include/bits/stl_tree.h (_Rb_tree): Declare _Rb_tree<> as friend.
	(_Rb_tree::node_type, _Rb_tree::insert_return_type)
	(_Rb_tree::_M_reinsert_node_unique, _Rb_tree::_M_reinsert_node_equal)
	(_Rb_tree::_M_reinsert_node_hint_unique)
	(_Rb_tree::_M_reinsert_node_hint_equal, _Rb_tree::extract)
	(_Rb_tree::_M_merge_unique, _Rb_tree::_M_merge_equal): Define.
	(_Rb_tree_merge_helper): Specialize for multiset.
	* include/bits/unordered_map.h (unordered_map): Declare
	unordered_map<> and unordered_multimap<> as friends.
	(unordered_map::node_type, unordered_map::insert_return_type)
	(unordered_map::extract, unordered_map::merge)
	(unordered_map::insert(node_type&&))
	(unordered_map::insert(const_iterator, node_type&&))
	(unordered_multimap): Declare _Hash_merge_helper as friend.
	(unordered_multimap::node_type, unordered_multimap::extract)
	(unordered_multimap::merge, unordered_multimap::insert(node_type&&))
	(unordered_multimap::insert(const_iterator, node_type&&)): Define.
	(_Hash_merge_helper): Specialize for unordered maps and multimaps.
	* include/bits/unordered_set.h (unordered_set, unordered_multiset):
	Declare _Hash_merge_helper as friend.
	(unordered_set::node_type, unordered_set::insert_return_type)
	(unordered_set::extract, unordered_set::merge)
	(unordered_set::insert(node_type&&))
	(unordered_set::insert(const_iterator, node_type&&)): Define.
	(unordered_multiset::node_type, unordered_multiset::extract)
	(unordered_multiset::merge, unordered_multiset::insert(node_type&&))
	(unordered_multiset::insert(const_iterator, node_type&&)): Define.
	(_Hash_merge_helper): Specialize for unordered sets and multisets.
	* include/debug/map.h (map): Add using declarations or forwarding
	functions for new members.
	* include/debug/map.h (multimap): Likewise.
	* include/debug/map.h (multiset): Likewise.
	* include/debug/map.h (set): Likewise.
	* include/debug/unordered_map (unordered_map, unordered_multimap):
	Likewise.
	* include/debug/unordered_set( unordered_set, unordered_multiset):
	Likewise.
	* python/libstdcxx/v6/printers.py (get_value_from_aligned_membuf): New
	helper function.
	(get_value_from_list_node, get_value_from_Rb_tree_node): Use helper.
	(StdNodeHandlePrinter): Define printer for node handles.
	(build_libstdcxx_dictionary): Register StdNodeHandlePrinter.
	* testsuite/23_containers/map/modifiers/extract.cc: New.
	* testsuite/23_containers/map/modifiers/merge.cc: New.
	* testsuite/23_containers/multimap/modifiers/extract.cc: New.
	* testsuite/23_containers/multimap/modifiers/merge.cc: New.
	* testsuite/23_containers/multiset/modifiers/extract.cc: New.
	* testsuite/23_containers/multiset/modifiers/merge.cc: New.
	* testsuite/23_containers/set/modifiers/extract.cc: New.
	* testsuite/23_containers/set/modifiers/merge.cc: New.
	* testsuite/23_containers/unordered_map/modifiers/extract.cc: New.
	* testsuite/23_containers/unordered_map/modifiers/merge.cc: New.
	* testsuite/23_containers/unordered_multimap/modifiers/extract.cc:
	New.
	* testsuite/23_containers/unordered_multimap/modifiers/merge.cc: New.
	* testsuite/23_containers/unordered_multiset/modifiers/extract.cc:
	New.
	* testsuite/23_containers/unordered_multiset/modifiers/merge.cc: New.
	* testsuite/23_containers/unordered_set/modifiers/extract.cc: New.
	* testsuite/23_containers/unordered_set/modifiers/merge.cc: New.
	* testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust
	dg-error lineno.
	* testsuite/libstdc++-prettyprinters/cxx17.cc: Test node handles.

From-SVN: r240363
2016-09-22 14:58:49 +01:00
Trevor Saunders
475edec070 make next_cc0_user take rtx_insn *
gcc/ChangeLog:

2016-09-22  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* emit-rtl.c (next_cc0_user): Make argument type rtx_insn *.
	* rtl.h: Adjust prototype.

From-SVN: r240362
2016-09-22 13:17:34 +00:00
Trevor Saunders
7c9796eddb make next/prev active_insn and active_insn_p take rtx_insn *
gcc/ChangeLog:

2016-09-22  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* emit-rtl.c (next_active_insn): Change argument type to
	rtx_insn *.
	(prev_active_insn): Likewise.
	(active_insn_p): Likewise.
	* rtl.h: Adjust prototypes.
	* cfgcleanup.c (merge_blocks_move_successor_nojumps): Adjust.
	* config/arc/arc.md: Likewise.
	* config/pa/pa.c (branch_to_delay_slot_p): Likewise.
	(branch_needs_nop_p): Likewise.
	(use_skip_p): Likewise.
	* config/sh/sh.c (gen_block_redirect): Likewise.
	(split_branches): Likewise.
	* reorg.c (optimize_skip): Likewise.
	(fill_simple_delay_slots): Likewise.
	(fill_slots_from_thread): Likewise.
	(relax_delay_slots): Likewise.
	* resource.c (mark_target_live_regs): Likewise.

From-SVN: r240361
2016-09-22 13:16:41 +00:00
Trevor Saunders
1f00691e9b make next/prev nonnote_nondebug_insn take rtx_insn *
gcc/ChangeLog:

2016-09-22  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/cris/cris.c (cris_asm_output_case_end): Change argument
	type to rtx_insn *.
	* emit-rtl.c (next_nonnote_nondebug_insn): Likewise.
	(prev_nonnote_nondebug_insn): Likewise.
	* config/cris/cris-protos.h: Adjust prototype.
	* rtl.h: Likewise.
	* jump.c (rtx_renumbered_equal_p): Adjust.

From-SVN: r240360
2016-09-22 13:16:35 +00:00
Trevor Saunders
d8fd56b226 make prev_real_insn take rtx_insn *
gcc/ChangeLog:

2016-09-22  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* emit-rtl.c (prev_real_insn): Change argument type to rtx_insn *.
	* rtl.h: Adjust prototype.
	* config/sh/sh.md: Adjust.
	* dwarf2out.c (add_var_loc_to_decl): Likewise.

From-SVN: r240359
2016-09-22 13:16:30 +00:00
Trevor Saunders
30d2ef86a9 make next/prev nondebug_insn take rtx_insn *
gcc/ChangeLog:

2016-09-22  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* emit-rtl.c (next_nondebug_insn): Change argument type to
	rtx_insn *.
	(prev_nondebug_insn): Likewise.
	* loop-doloop.c (doloop_condition_get): Likewise.
	* rtl.h: Adjust prototype.
	* cfgloop.h: Likewise.

From-SVN: r240358
2016-09-22 13:16:23 +00:00
Trevor Saunders
c9b0a22777 make next/prev _nonnote_insn take rtx_insn *
gcc/ChangeLog:

2016-09-22  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* emit-rtl.c (next_nonnote_insn): Change argument type to
	rtx_insn *.
	(prev_nonnote_insn): Likewise.
	* jump.c (reversed_comparison_code_parts): Likewise.
	(reversed_comparison): Likewise.
	* rtl.h: Adjust prototypes.
	* config/arc/arc.md: Adjust.
	* cse.c (find_comparison_args): Likewise.
	* reorg.c (redundant_insn): Change return type to rtx_insn *.
	(fix_reg_dead_note): Change argument type to rtx_insn *.
	(delete_prior_computation): Likewise.
	(delete_computation): Likewise.
	(fill_slots_from_thread): Adjust.
	(relax_delay_slots): Likewise.
	* simplify-rtx.c (simplify_unary_operation_1): Likewise.
	(simplify_relational_operation_1): Likewise.
	(simplify_ternary_operation): Likewise.

From-SVN: r240357
2016-09-22 13:16:17 +00:00
Trevor Saunders
82082f658e use rtx_insn * more
gcc/ChangeLog:

2016-09-22  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/arc/arc-protos.h (arc_label_align): Change type of
	variables from rtx to rtx_insn *.
	* config/arc/arc.c (arc_label_align): Likewise.
	* config/arm/arm.c (any_sibcall_could_use_r3): Likewise.
	* config/bfin/bfin.c (workaround_speculation): Likewise.
	* config/c6x/c6x.c (find_next_cycle_insn): Likewise.
	(find_last_same_clock): Likewise.
	(reorg_split_calls): Likewise.
	* config/cris/cris-protos.h (cris_cc0_user_requires_cmp): Likewise.
	* config/cris/cris.c (cris_cc0_user_requires_cmp): Likewise.
	* config/h8300/h8300-protos.h (same_cmp_preceding_p): Likewise.
	(same_cmp_following_p): Likewise.
	* config/h8300/h8300.c (same_cmp_preceding_p): Likewise.
	(same_cmp_following_p): Likwise.
	* config/m32r/m32r.c (m32r_expand_epilogue): Likewise.
	* config/nds32/nds32-protos.h (nds32_target_alignment): Likewise.
	* config/nds32/nds32.c (nds32_target_alignment): Likewise.
	* config/rl78/rl78.c (rl78_alloc_physical_registers_op2):
	* Likewise.
	(rl78_alloc_physical_registers_cmp): Likewise.
	(rl78_alloc_physical_registers_umul): Likewise.
	(rl78_calculate_death_notes): Likewise.
	* config/s390/s390-protos.h (s390_label_align): Likewise.
	* config/s390/s390.c (s390_label_align): Likewise.
	* config/sh/sh.c (barrier_align): Likewise.
	* config/sparc/sparc-protos.h (emit_cbcond_nop): Likewise.
	* config/sparc/sparc.c (sparc_asm_function_epilogue): Likewise.
	(emit_cbcond_nop): Likewise.

From-SVN: r240356
2016-09-22 13:16:11 +00:00
Bernd Edlinger
d94a7ab418 pr77550.C: Use __SIZE_TYPE__.
2016-09-22  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * g++.dg/pr77550.C: Use __SIZE_TYPE__.

From-SVN: r240355
2016-09-22 12:57:19 +00:00
Martin Liska
a13f439f47 re PR ipa/77653 (wrong code at -Os and above on x86_64-linux-gnu (in both 32-bit and 64-bit modes))
Fix PR ipa/77653

	PR ipa/77653
	* gcc.dg/ipa/pr77653.c: New test.
	PR ipa/77653
	* ipa-icf.c (sem_variable::merge): Yield merge operation if
	alias address matters, not necessarily address of original.

From-SVN: r240354
2016-09-22 12:52:09 +00:00
Richard Biener
9ef2eff0d4 re PR tree-optimization/77697 (suspicious code in tree-ssa-forwprop.c)
2016-09-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/77697
	* gimple-fold.c (fold_array_ctor_reference): Turn asserts into
	fold fails.

From-SVN: r240353
2016-09-22 12:16:42 +00:00
Richard Biener
1f3131cb1e re PR tree-optimization/77677 (ICE at -O1 and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in set_value_range, at tree-vrp.c:361))
2016-09-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/77677
	* gimple-match-head.c (gimple_resimplify1): Drop TREE_OVERFLOW
	from constant folding results.
	(gimple_resimplify2): Likewise.
	(gimple_resimplify3): Likewise.

From-SVN: r240352
2016-09-22 12:16:12 +00:00
Richard Biener
c813f2686a re PR fortran/77678 (ICE in fold_read_from_constant_string, at fold-const.c:13706)
2016-09-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/77678
	* expr.c (expand_expr_real_1): Guard array access against negative
	offset.

From-SVN: r240351
2016-09-22 12:15:38 +00:00
Rainer Orth
b8ffdd9730 Use GMP_RNDN for portability to MPFR 2.4.2
* gimple-ssa-sprintf.c (format_floating_max): Use GMP_RNDN instead
	of MPFR_RNDN.
	(format_floating): Likewise.

From-SVN: r240350
2016-09-22 11:33:25 +00:00
Paul Thomas
195d1431ff re PR fortran/48298 ([F03] User-Defined Derived-Type IO (DTIO))
2016-09-22  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/48298
	* gfortran.h : Place the pseudo operators INTRINSIC_FORMATTED
	and INTRINSIC_UNFORMATTED after the sentinel in enum
	gfc_intrinsic_op so that they do not appear as place holders
	in module_write.
	* interface.c (dtio_op): Comment on the special nature of the
	pseudo operators INTRINSIC FORMATTED and INTRINSIC_UNFORMATTED.

From-SVN: r240349
2016-09-22 11:26:59 +00:00
Jakub Jelinek
cf352092e2 re PR tree-optimization/77665 (ICE in expand_GOMP_SIMD_VF, at internal-fn.c:172)
PR fortran/77665
	* tree-inline.c (remap_gimple_stmt): Set has_simduid_loops
	for all IFN_GOMP_SIMD_* internal fns, not just for
	IFN_GOMP_SIMD_ORDERED_*.

	* gfortran.dg/gomp/pr77665.f90: New test.

From-SVN: r240348
2016-09-22 13:17:24 +02:00
Ville Voutilainen
8a4c4f1273 Fix tests on old arm platforms for optional.
* testsuite/20_util/optional/77288.cc: Don't use exception_ptr.

From-SVN: r240347
2016-09-22 14:01:29 +03:00
Richard Biener
687235522b class.c (push_super_field): Set DECL_CONTEXT.
2016-09-22  Richard Biener  <rguenther@suse.de>

	java/
	* class.c (push_super_field): Set DECL_CONTEXT.

From-SVN: r240346
2016-09-22 10:54:41 +00:00
Jonathan Wakely
6fdc74c91b Update pretty printer for std::variant
* python/libstdcxx/v6/printers.py (StdVariantPrinter): Adjust for
	recent change to _Variant_storage.
	* testsuite/libstdc++-prettyprinters/cxx17.cc: Test variant with
	reference type.

From-SVN: r240345
2016-09-22 11:06:41 +01:00
Jonathan Wakely
64626fcaaa Always qualify std::forward in <variant>
* include/bits/uses_allocator.h (__uses_allocator_construct): Qualify
	std::forward and ::new. Cast pointer to void*.
	* include/std/variant (_Variant_storage, _Union, _Variant_base)
	(__access, __visit_invoke, variant, visit): Qualify std::forward.
	* testsuite/20_util/variant/compile.cc: Test for ADL problems.

From-SVN: r240344
2016-09-22 10:56:54 +01:00
Tim Shen
c42bc5d73b variant (variant::operator=): Fix assignment on references.
* libstdc++-v3/include/std/variant (variant::operator=): Fix assignment
	on references.
	* libstdc++-v3/testsuite/20_util/variant/compile.cc: Add test.

From-SVN: r240343
2016-09-22 08:45:55 +00:00
Paul Thomas
a8de3002f1 interface.c (check_dtio_interface1): Introduce errors for alternate returns and incorrect numbers of arguments.
2016-09-22  Paul Thomas  <pault@gcc.gnu.org>

	* interface.c (check_dtio_interface1): Introduce errors for
	alternate returns and incorrect numbers of arguments.
	(gfc_find_specific_dtio_proc): Return cleanly if the derived
	type either doesn't exist or has no namespace.

2016-09-22  Paul Thomas  <pault@gcc.gnu.org>

	* gfortran.dg/dtio_11.f90: Correct for changed error messages.
	* gfortran.dg/dtio_13.f90: New test.

From-SVN: r240342
2016-09-22 07:46:07 +00:00
Louis Krupp
39abef62a1 re PR fortran/66107 (ICE on missing parameter value for initialisation (segfault))
2016-09-21  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/66107
	* gfortran.dg/pr66107.f90: New test.

2016-09-21  Louis Krupp  <louis.krupp@zoho.com>

	PR fortran/66107
	* decl.c (add_init_expr_to_sym): Catch variable character length
	in parameter array.

From-SVN: r240341
2016-09-22 07:07:53 +00:00
Tim Shen
41501d1ae7 re PR libstdc++/77641 (std::variant copy-initialization fails for type with non-trivial constexpr ctor)
PR libstdc++/77641
	* include/std/variant (_Variant_storage::_Variant_storage):
	Change _Variant_storage's union to be default constructible.
	* testsuite/20_util/variant/compile.cc: New test.

From-SVN: r240340
2016-09-22 03:15:58 +00:00
GCC Administrator
77d7987a0c Daily bump.
From-SVN: r240339
2016-09-22 00:16:15 +00:00
Michael Meissner
ff4bb3b552 re PR target/77670 (PowerPC64 Spec 2006 fails on 453.povray using -mcpu=power9 -mpower9-minmax)
2016-09-21  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/77670
	* config/rs6000/predicates.md (invert_fpmask_comparison_operator):
	New predicate that matches the ISA 3.0 XSCMP{EQ,GT,GE}DP
	instructions when you want to invert the test.
	* config/rs6000/rs6000.md (fpmask<mode>): Use the arguments in the
	correct order for XXSEL.
	(mov<SFDF:mode><SFDF2:mode>cc_invert_p9): Define the inverted test
	for using XSCMP{EQ,GT,GE}DP.

From-SVN: r240336
2016-09-21 22:12:13 +00:00
Michael Meissner
72d1c8dd83 re PR target/77670 (PowerPC64 Spec 2006 fails on 453.povray using -mcpu=power9 -mpower9-minmax)
2016-09-21  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/77670
	* config/rs6000/predicates.md (invert_fpmask_comparison_operator):
	New predicate that matches the ISA 3.0 XSCMP{EQ,GT,GE}DP
	instructions when you want to invert the test.
	* config/rs6000/rs6000.md (fpmask<mode>): Use the arguments in the
	correct order for XXSEL.
	(mov<SFDF:mode><SFDF2:mode>cc_invert_p9): Define the inverted test
	for using XSCMP{EQ,GT,GE}DP.

From-SVN: r240335
2016-09-21 22:11:42 +00:00
Ian Lance Taylor
4a2bb7fcb0 compiler, runtime: replace hashmap code with Go 1.7 hashmap
This change removes the gccgo-specific hashmap code and replaces it with
    the hashmap code from the Go 1.7 runtime.  The Go 1.7 hashmap code is
    more efficient, does a better job on details like when to update a key,
    and provides some support against denial-of-service attacks.
    
    The compiler is changed to call the new hashmap functions instead of the
    old ones.
    
    The compiler now tracks which types are reflexive and which require
    updating when used as a map key, and records the information in map type
    descriptors.
    
    Map_index_expression is simplified.  The special case for a map index on
    the right hand side of a tuple expression has been unnecessary for some
    time, and is removed.  The support for specially marking a map index as
    an lvalue is removed, in favor of lowering an assignment to a map index
    into a function call.  The long-obsolete support for a map index of a
    pointer to a map is removed.
    
    The __go_new_map_big function (known to the compiler as
    Runtime::MAKEMAPBIG) is no longer needed, as the new runtime.makemap
    function takes an int64 hint argument.
    
    The old map descriptor type and supporting expression is removed.
    
    The compiler was still supporting the long-obsolete syntax `m[k] = 0,
    false` to delete a value from a map.  That is now removed, requiring a
    change to one of the gccgo-specific tests.
    
    The builtin len function applied to a map or channel p is now compiled
    as `p == nil ? 0 : *(*int)(p)`.  The __go_chan_len function (known to
    the compiler as Runtime::CHAN_LEN) is removed.
    
    Support for a shared zero value for maps to large value types is
    introduced, along the lines of the gc compiler.  The zero value is
    handled as a common variable.
    
    The hash function is changed to take a seed argument, changing the
    runtime hash functions and the compiler-generated hash functions.
    Unlike the gc compiler, both the hash and equal functions continue to
    take the type length.
    
    Types that can not be compared now store nil for the hash and equal
    functions, rather than pointing to functions that throw.  Interface hash
    and comparison functions now check explicitly for nil.  This matches the
    gc compiler and permits a simple implementation for ismapkey.
    
    The compiler is changed to permit marking struct and array types as
    incomparable, meaning that they have no hash or equal function.  We use
    this for thunk types, removing the existing special code to avoid
    generating hash/equal functions for them.
    
    The C runtime code adds memclr, memequal, and memmove functions.
    
    The hashmap code uses go:linkname comments to make the functions
    visible, as otherwise the compiler would discard them.
    
    The hashmap code comments out the unused reference to the address of the
    first parameter in the race code, as otherwise the compiler thinks that
    the parameter escapes and copies it onto the heap.  This is probably not
    needed when we enable escape analysis.
    
    Several runtime map tests that ere previously skipped for gccgo are now
    run.
    
    The Go runtime picks up type kind information and stubs.  The type kind
    information causes the generated runtime header file to define some
    constants, including `empty`, and the C code is adjusted accordingly.
    
    A Go-callable version of runtime.throw, that takes a Go string, is
    added to be called from the hashmap code.
    
    Reviewed-on: https://go-review.googlesource.com/29447

	* go.go-torture/execute/map-1.go: Replace old map deletion syntax
	with call to builtin delete function.

From-SVN: r240334
2016-09-21 20:58:51 +00:00
David Malcolm
812b1403a8 Introduce class rtx_reader
Bundle up various global variables within gensupport.c into a
class rtx_reader, with a view towards making it easier to run the
code more than once in-process.

gcc/ChangeLog:
	* genconstants.c (main): Introduce noop_reader and convert call
	to read_md_files to a method call.
	* genenums.c (main): Likewise.
	* genmddeps.c (main): Likewise.
	* genpreds.c (write_tm_constrs_h): Replace use of "in_fname" with
	rtx_reader_ptr->get_top_level_filename ().
	(write_tm_preds_h): Likewise.
	(write_insn_preds_c): Likewise.
	* gensupport.c (class gen_reader): New subclass of rtx_reader.
	(rtx_handle_directive): Convert to...
	(gen_reader::handle_unknown_directive): ...this.
	(init_rtx_reader_args_cb): Convert return type from bool to
	rtx_reader *.  Create a gen_reader instance, using it for the
	call to read_md_files.  Return it if no errors occur.
	(init_rtx_reader_args): Convert return type from bool to
	rtx_reader *.
	* gensupport.h (init_rtx_reader_args_cb): Likewise.
	(init_rtx_reader_args_cb): Likewise.
	* read-md.c (struct file_name_list): Move to class rtx_reader.
	(read_md_file): Delete in favor of rtx_reader::m_read_md_file.
	(read_md_filename): Delete in favor of
	rtx_reader::m_read_md_filename.
	(read_md_lineno): Delete in favor of rtx_reader::m_read_md_lineno.
	(in_fname): Delete in favor of rtx_reader::m_toplevel_fname.
	(base_dir): Delete in favor of rtx_reader::m_base_dir.
	(first_dir_md_include): Delete in favor of
	rtx_reader::m_first_dir_md_include.
	(last_dir_md_include_ptr): Delete in favor of
	rtx_reader::m_last_dir_md_include_ptr.
	(max_include_len): Delete.
	(rtx_reader_ptr): New.
	(fatal_with_file_and_line): Use get_filename and get_lineno
	accessors of rtx_reader_ptr.
	(require_char_ws): Likewise.
	(rtx_reader::read_char): New method, based on ::read_char.
	(rtx_reader::unread_char): New method, based on ::unread_char.
	(read_escape): Use get_filename and get_lineno accessors of
	rtx_reader_ptr.
	(read_braced_string): Use get_lineno accessor of rtx_reader_ptr.
	(read_string): Use get_filename and get_lineno accessors of
	rtx_reader_ptr.
	(rtx_reader::rtx_reader): New ctor.
	(rtx_reader::~rtx_reader): New dtor.
	(handle_include): Convert from a function to...
	(rtx_reader::handle_include): ...this method, converting
	handle_directive from a callback to a virtual function.
	(handle_file): Likewise, converting to...
	(rtx_reader::handle_file): ...this method.
	(handle_toplevel_file): Likewise, converting to...
	(rtx_reader::handle_toplevel_file): ...this method.
	(rtx_reader::get_current_location): New method.
	(parse_include): Convert from a function to...
	(rtx_reader::add_include_path): ...this method, dropping redundant
	update to unused max_include_len.
	(read_md_files): Convert from a function to...
	(rtx_reader::read_md_files): ...this method, converting
	handle_directive from a callback to a virtual function.
	(noop_reader::handle_unknown_directive): New method.
	* read-md.h (directive_handler_t): Delete this typedef.
	(in_fname): Delete.
	(read_md_file): Delete.
	(read_md_lineno): Delete.
	(read_md_filename): Delete.
	(class rtx_reader): New class.
	(rtx_reader_ptr): New decl.
	(class noop_reader): New subclass of rtx_reader.
	(read_char): Reimplement in terms of rtx_reader::read_char.
	(unread_char): Reimplement in terms of rtx_reader::unread_char.
	(read_md_files): Delete.
	* read-rtl.c (read_rtx_code): Update for deletion of globals
	read_md_filename and read_md_lineno.

From-SVN: r240333
2016-09-21 20:55:06 +00:00
Michael Meissner
0d7154371d Add PR target/71395 marker to 71395 fix
From-SVN: r240332
2016-09-21 20:17:32 +00:00