Commit Graph

162311 Commits

Author SHA1 Message Date
François Dumont 89de39a98f 2018-06-21 François Dumont <fdumont@gcc.gnu.org>
Fix this ChangeLog entry.

From-SVN: r261878
2018-06-22 05:23:47 +00:00
GCC Administrator f76e076802 Daily bump.
From-SVN: r261877
2018-06-22 00:16:44 +00:00
Jonathan Wakely d72888d340 PR libstdc++/86138 prevent implicit instantiation of COW empty rep
The explicit instantiation declarations for std::basic_string are
disabled for C++17 (and later) so that basic_string symbols get
implicitly instantiated in every translation unit that needs them.  On
targets that don't support STB_GNU_UNIQUE this leads to multiple copies
of the empty rep symbol for COW strings. In order to detect whether a
COW string needs to deallocate its storage it compares the address with
the empty rep.  When there are multiple copies of the empty rep object
the address is not unique, and so string destructors try to delete the
empty rep, which crashes.

In order to guarantee uniqueness of the _S_empty_rep_storage symbol this
patch adds an explicit instantiation declaration for just that symbol.
This means the other symbols are still implicitly instantiated in C++17
code, but for the empty rep the definition in the library gets used.

Separately, there is no need for C++17 code to implicitly instantiate
the I/O functions for strings, so this also restores the explicit
instantiation declarations for those functions.

	PR libstdc++/86138
	* include/bits/basic_string.tcc:
	[__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI]
	(basic_string<char>::_Rep::_S_empty_rep_storage)
	(basic_string<wchar_t>::_Rep::_S_empty_rep_storage): Add explicit
	instantiation declarations.
	[__cplusplus > 201402] (operator>>, operator<<, getline): Re-enable
	explicit instantiation declarations.
	* testsuite/21_strings/basic_string/cons/char/86138.cc: New.
	* testsuite/21_strings/basic_string/cons/wchar_t/86138.cc: New.

From-SVN: r261873
2018-06-22 00:29:01 +01:00
Michael Meissner 30043df975 pack02.c: Use __ibm128 instead of long double if the long double format is IEEE 128-bit...
2018-06-21  Michael Meissner  <meissner@linux.ibm.com>

	* gcc.target/powerpc/pack02.c: Use __ibm128 instead of long double
	if the long double format is IEEE 128-bit for tests that are
	explicitly testing IBM extended double support.  Use the
	appropriate pack and unpack built-in functions.  Change calls from
	__builtin_isinfl to __builtin_isinf since the later supports all
	floating point types.
	* gcc.target/powerpc/pr57150.c: Likewise.
	* gcc.target/powerpc/pr60203.c: Likewise.
	* gcc.target/powerpc/pr67808.c: Likewise.
	* gcc.target/powerpc/pr70117.c: Likewise.
	* gcc.target/powerpc/tfmode_off.c: Likewise.

From-SVN: r261872
2018-06-21 23:13:25 +00:00
Ian Lance Taylor 27fbc519e0 cmd/go: re-enable a couple of tests of gccgo
Port https://golang.org/cl/120375 over to the gofrontend repo so that
    it gets more reliable testing.
    
    Updates golang/go#22472
    
    Reviewed-on: https://go-review.googlesource.com/120395

From-SVN: r261871
2018-06-21 23:02:25 +00:00
Michael Meissner ed044066ac rs6000.c (init_float128_ieee): Prevent complex multiply and divide external functions from being created more...
2018-06-23  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.c (init_float128_ieee): Prevent complex
	multiply and divide external functions from being created more
	than once.

From-SVN: r261870
2018-06-21 22:55:50 +00:00
Michael Meissner e8ccf82411 rs6000.md (neg<mode>2_internal): Use the correct mode to check whether the mode is IBM extended.
2018-06-21  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.md (neg<mode>2_internal): Use the correct
	mode to check whether the mode is IBM extended.

From-SVN: r261869
2018-06-21 22:49:37 +00:00
Paul Thomas 77f72c95fa re PR fortran/49630 ([OOP] ICE on obsolescent deferred-length type bound character function)
2018-06-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/49630
	* resolve.c (resolve_contained_fntype): Change standard ref.
	from F95 to F2003: C418. Correct a spelling error in a comment.
	It is an error for an abstract interface to have an assumed
	character length result.
	* trans-expr.c (gfc_conv_procedure_call): Likewise change the
	standard reference.

2018-06-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/49630
	* gfortran.dg/assumed_charlen_function_7.f90: New test.

From-SVN: r261868
2018-06-21 22:38:55 +00:00
Michael Meissner fe5309c50d rs6000.md (extendtfif2): Add missing 128-bit conversion insn that shows up when...
2018-06-21  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.md (extendtfif2): Add missing 128-bit
	conversion insn that shows up when pr85657-3.c is compiled using
	IEEE 128-bit long double.

From-SVN: r261867
2018-06-21 22:16:20 +00:00
Jonathan Wakely cda121ac7a PR libstdc++/83328 add correct basic_string::insert for initializer_list
The SSO basic_string has a non-standard insert(iterator, initializer_list)
overload, from a C++0x draft. This adds the correct overload, while also
preserving the old one so that the old symbol is still exported from the
library.

The COW basic_string doesn't have any of the C++11 changes to the insert
overloads (they all still have non-const iterator parameters and the
ones that should return an iterator still return void). This doesn't
make any change to the COW string.

	PR libstdc++/83328
	* acinclude.m4 (libtool_VERSION): Bump to 6:26:0.
	* config/abi/pre/gnu.ver: Add GLIBCXX_3.4.26 and export new symbol.
	* configure: Regenerate.
	* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
	(basic_string::insert(const_iterator, initializer_list<C>)): Add.
	[_GLIBCXX_USE_CXX11_ABI && !_GLIBCXX_DEFINING_STRING_INSTANTIATIONS]
	(basic_string::insert(iterator, initializer_list<C>)): Suppress
	definition.
	* include/debug/string (basic_string::insert(iterator, C)): Change
	first parameter to const_iterator.
	(basic_string::insert(iterator, size_type, C)): Likewise. Change
	return type to iterator.
	(basic_string::insert(iterator, InputIterator, InputIterator)):
	Likewise.
	(basic_string::insert(iterator, initializer_list<C>)): Change first
	parameter to const_iterator and return type to iterator.
	* src/c++11/string-inst.cc: Extend comment.
	* testsuite/21_strings/basic_string/modifiers/insert/char/83328.cc:
	New.
	* testsuite/21_strings/basic_string/modifiers/insert/wchar_t/83328.cc:
	New.
	* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r261866
2018-06-21 23:01:25 +01:00
Jonathan Wakely 5cfd862095 * config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
From-SVN: r261865
2018-06-21 21:57:07 +01:00
Jason Merrill 40a380e423 * pt.c (tsubst) [TEMPLATE_TYPE_PARM]: Use TEMPLATE_PARM_DESCENDANTS.
From-SVN: r261861
2018-06-21 14:19:38 -04:00
Jason Merrill 50200c6539 Reduce garbage from push_to_top_level.
* name-lookup.c (do_push_to_top_level): Don't allocate
	current_lang_base.
	(do_pop_from_top_level): Release current_lang_base.

From-SVN: r261860
2018-06-21 14:19:34 -04:00
Jason Merrill 6ec04704df Let -fmem-report see callers of cxx_make_type.
* lex.c (cxx_make_type): Add MEM_STAT_DECL.
	(make_class_type): Likewise.
	(cxx_make_type_hook): New.
	* cp-objcp-common.h (LANG_HOOKS_MAKE_TYPE): Use cxx_make_type_hook.

From-SVN: r261859
2018-06-21 14:19:29 -04:00
Jason Merrill 8745500a49 PR c++/86182 - fix wrong PR tag in earlier commit
From-SVN: r261858
2018-06-21 14:19:23 -04:00
Paul Thomas 75382a9665 re PR fortran/83118 (Bad intrinsic assignment of class(*) array component of derived type)
2018-06-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83118
	* resolve.c (resolve_ordinary_assign): Force the creation of a
	vtable for assignment of non-polymorphic expressions to an
	unlimited polymorphic object.
	* trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
	size of the rhs type for such assignments. Set the dtype, _len
	and vptrs appropriately.
	* trans-expr.c (gfc_trans_assignment): Force the use of the
	_copy function for these assignments.

2018-06-21  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83118
	* gfortran.dg/unlimited_polymorphic_30.f03: New test.

From-SVN: r261857
2018-06-21 17:34:31 +00:00
Eric Botcazou 7792f13c84 cfgrtl.c (fixup_reorder_chain): Do not emit NOPs in DECL_IGNORED_P functions.
* cfgrtl.c (fixup_reorder_chain): Do not emit NOPs in DECL_IGNORED_P
	functions.
	(rtl_merge_blocks): Likewise.  Do not emit a NOP if the location of
	the edge can be forwarded.
	(cfg_layout_merge_blocks): Likewise.

From-SVN: r261856
2018-06-21 17:03:58 +00:00
Eric Botcazou 56b97603ec except.c (finish_eh_generation): Commit edge insertions only after the EH edges have been redirected from...
* except.c (finish_eh_generation): Commit edge insertions only after
	the EH edges have been redirected from post-landing to landing pads.

From-SVN: r261855
2018-06-21 17:02:13 +00:00
Eric Botcazou 575b192558 tree-nested.c (get_frame_type): Use create_tmp_var_raw instead of create_tmp_var_for to create the FRAME decl.
* tree-nested.c (get_frame_type): Use create_tmp_var_raw instead of
	create_tmp_var_for to create the FRAME decl.
	(finalize_nesting_tree_1): Do not unchain the FRAME decl.

From-SVN: r261854
2018-06-21 17:01:12 +00:00
Eric Botcazou 29cbd18b58 tree-inline.c (copy_edges_for_bb): Minor tweak.
* tree-inline.c (copy_edges_for_bb): Minor tweak.
	(maybe_move_debug_stmts_to_successors): Also reset the locus of the
	debug statement when resetting its value.
	(expand_call_inline): Copy the locus of the call onto the assignment
	of the return value, if any.  Use local variable in more cases.

From-SVN: r261853
2018-06-21 16:59:28 +00:00
Jonathan Wakely e9df6a8f03 PR libstdc++/70940 make pmr::resource_adaptor return aligned memory
PR libstdc++/70940
	* include/experimental/memory_resource
	(__resource_adaptor_imp::do_deallocate): Add missing return.
	* testsuite/experimental/memory_resource/new_delete_resource.cc: New.
	* testsuite/experimental/memory_resource/resource_adaptor.cc: Test
	resource_adaptor with std::allocator, __gnu_cxx::new_allocator and
	__gnu_cxx::malloc_allocator.

From-SVN: r261851
2018-06-21 17:24:00 +01:00
Jonathan Wakely 7956c508dd PR libstdc++/70940 make pmr::resource_adaptor return aligned memory
PR libstdc++/70940
	* include/experimental/memory_resource (__resource_adaptor_common):
	New base class.
	(__resource_adaptor_common::_AlignMgr): Helper for obtaining aligned
	pointer from unaligned, and vice versa.
	(__resource_adaptor_imp::do_allocate): Use _AlignMgr to adjust
	allocated pointer to meet alignment request.
	(__resource_adaptor_imp::do_deallocate): Use _AlignMgr to retrieve
	original pointer for deallocation.
	(__resource_adaptor_imp::do_is_equal): Reformat.
	(__resource_adaptor_imp::_S_aligned_size): Remove.
	(__resource_adaptor_imp::_S_supported): Remove.
	(new_delete_resource): Use __gnu_cxx::new_allocator.
	* testsuite/experimental/memory_resource/resource_adaptor.cc: Test
	extended alignments and use debug_allocator to check for matching
	allocate/deallocate pairs.

From-SVN: r261849
2018-06-21 15:01:11 +01:00
Martin Liska 67b3b8feb3 IPA summaries use ::get in ipa-pure-const.c.
2018-06-21  Martin Liska  <mliska@suse.cz>

	* ipa-pure-const.c (propagate_nothrow): Use
        funct_state_summaries->get.
	(dump_malloc_lattice): Likewise.
	(propagate_malloc): Likewise.

From-SVN: r261848
2018-06-21 13:53:30 +00:00
Richard Biener f5fe239ec9 lto-streamer-out.c (DFS::DFS_write_tree_body): Update outdated comment.
2018-06-21  Richard Biener  <rguenther@suse.de>

	* lto-streamer-out.c (DFS::DFS_write_tree_body): Update outdated
	comment.  Follow BLOCK_ABSTRACT_ORIGIN unconditionally.
	* tree-streamer-in.c (lto_input_ts_block_tree_pointers): Update
	comment.
	* tree-streamer-out.c (write_ts_block_tree_pointers): Stream
	BLOCK_ABSTRACT_ORIGIN unconditionally.

From-SVN: r261847
2018-06-21 13:47:48 +00:00
David Malcolm e67343d744 Fix IPA crash in libgccjit
gcc/ChangeLog:
	* ipa-cp.c (ipcp_driver): Set edge_clone_summaries to NULL after
	deleting it.
	* ipa-reference.c (ipa_reference_c_finalize): Delete
	ipa_ref_opt_sum_summaries and set it to NULL.

From-SVN: r261846
2018-06-21 13:44:38 +00:00
Tom de Vries d22d74e09d [testsuite] Fix guality/pr45882.c for flto
Atm this test in pr45882.c fails:
...
  int d = a[i];  /* { dg-final { gdb-test 16 "d" "112" } } */
...
as follows:
...
FAIL: gcc.dg/guality/pr45882.c   -O2 -flto -fuse-linker-plugin \
      -fno-fat-lto-objects  line 16 d == 112
...

In more detail, gdb fails to print the value of d:
...
Breakpoint 1, foo (i=i@entry=7, j=j@entry=7) at pr45882.c:16
16        ++v;
$1 = <optimized out>
$2 = 112
<optimized out> != 112
...

Variable d is a local variable in function foo, initialized from global array a.
When compiling, first cddce1 removes the initialization of d in foo, given
that d is not used afterwards.  Then ipa marks array a as write-only, and
removes the stores to array a in main.  This invalidates the location
expression for d, which points to a[i], so it is removed, which is why gdb
ends up printing <optimized out> for d.

This patches fixes the fail by adding attribute used to array a, preventing
array a from being marked as write-only.

Tested on x86_64.

2018-06-21  Tom de Vries  <tdevries@suse.de>

	* gcc.dg/guality/pr45882.c (a): Add used attribute.

From-SVN: r261845
2018-06-21 13:37:59 +00:00
Tom de Vries 494e75321f [tail-merge] Fix side-effect test in stmt_local_def
2018-06-21  Tom de Vries  <tdevries@suse.de>

	PR tree-optimization/85859
	* tree-ssa-tail-merge.c (stmt_local_def): Copy gimple_is_call
	test with comment from bb_no_side_effects_p.

	* gcc.dg/pr85859.c: New test.

From-SVN: r261844
2018-06-21 12:44:38 +00:00
Richard Biener 8732dd8241 re PR tree-optimization/86232 (ICE in record_estimate, at tree-ssa-loop-niter.c:3258)
2018-06-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86232
	* tree-ssa-loop-niter.c (number_of_iterations_popcount): Adjust
	max for constant niter.

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

From-SVN: r261843
2018-06-21 11:22:12 +00:00
Christophe Lyon 9b2e34ef6d [ARM] Use __ARM_ARCH and __ARM_FEATURE_LDREX instead of __ARM_ARCH__
2018-06-21  Christophe Lyon  <christophe.lyon@linaro.org>

	libatomic/
	* config/arm/arm-config.h (__ARM_ARCH__): Remove definitions, use
	__ARM_ARCH instead. Use __ARM_FEATURE_LDREX to define HAVE_STREX
	and HAVE_STREXBHD

	libgcc/
	* config/arm/lib1funcs.S (__ARM_ARCH__): Remove definitions, use
	__ARM_ARCH and __ARM_FEATURE_CLZ instead.
	(HAVE_ARM_CLZ): Remove definition, use __ARM_FEATURE_CLZ instead.
	* config/arm/ieee754-df.S: Use __ARM_FEATURE_CLZ instead of
	__ARM_ARCH__.
	* config/arm/ieee754-sf.S: Likewise.
	* config/arm/libunwind.S: Use __ARM_ARCH instead of __ARM_ARCH__.

From-SVN: r261841
2018-06-21 13:05:36 +02:00
Christophe Lyon d1b0dd54ab [ARM] libgcc: Remove unsupported code for __ARM_ARCH__ < 4
2018-06-21  Christophe Lyon  <christophe.lyon@linaro.org>

	libgcc/
	* config/arm/ieee754-df.S: Remove code for __ARM_ARCH__ < 4, no
	longer supported.
	* config/arm/ieee754-sf.S: Likewise.

From-SVN: r261840
2018-06-21 13:01:05 +02:00
Andre Vieira 9b57fd3d96 [AArch64][PATCH 2/2] Combine AES instructions with xor and zero operands
gcc
2018-06-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/aarch64/aarch64-simd.md
	(*aarch64_crypto_aes<aes_op>v16qi_xor_combine): New.

gcc/testsuite
2018-06-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>

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

From-SVN: r261836
2018-06-21 09:08:43 +00:00
Andre Vieira ff02988392 [AArch64][PATCH 1/2] Make AES unspecs commutative
gcc
2018-06-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/aarch64/aarch64-simd.md (aarch64_crypto_aes<aes_op>v16qi):
	Make opernads of the unspec commutative.

gcc/testsuite
2018-06-21  Andre Vieira  <andre.simoesdiasvieira@arm.com>

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

From-SVN: r261835
2018-06-21 09:01:21 +00:00
Richard Biener 5fa234669f tree-data-ref.c (dr_step_indicator): Handle NULL DR_STEP.
2018-06-21  Richard Biener  <rguenther@suse.de>

	* tree-data-ref.c (dr_step_indicator): Handle NULL DR_STEP.
	* tree-vect-data-refs.c (vect_analyze_possibly_independent_ddr):
	Avoid calling vect_mark_for_runtime_alias_test with gathers or scatters.
	(vect_analyze_data_ref_dependence): Re-order checks to deal with
	NULL DR_STEP.
	(vect_record_base_alignments): Do not record base alignment
	for gathers or scatters.
	(vect_compute_data_ref_alignment): Drop return value that is always
	true.  Bail out early for gathers or scatters.
	(vect_enhance_data_refs_alignment): Bail out early for gathers
	or scatters.
	(vect_find_same_alignment_drs): Likewise.
	(vect_analyze_data_refs_alignment): Remove dead code.
	(vect_slp_analyze_and_verify_node_alignment): Likewise.
	(vect_analyze_data_refs): For possible gathers or scatters do
	not create an alternate DR, just check their possible validity
	and mark them.  Adjust DECL_NONALIASED handling to not rely
	on DR_BASE_ADDRESS.
	* tree-vect-loop-manip.c (vect_update_inits_of_drs): Do not
	update inits of gathers or scatters.
	* tree-vect-patterns.c (vect_recog_mask_conversion_pattern):
	Also copy gather/scatter flag to pattern vinfo.

From-SVN: r261834
2018-06-21 07:46:43 +00:00
Denis Khalikov 1ac6620a52 re PR other/86198 (Libbacktrace does not properly work with ".note.gnu.build-id" section)
libbacktrace/

2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>

	PR other/86198
	* elf.c (elf_add): Increase ".note.gnu.build-id" section size
	checking up to 36 bytes.

From-SVN: r261832
2018-06-21 08:42:53 +03:00
François Dumont 802743baca debug.h (_Safe_iterator<>(const _Safe_iterator<_MutableIterator,>& __x)): Compare __x base iterator with a default initialized iterator of the same type.
2018-06-21  François Dumont  <fdumont@gcc.gnu.org>

	* include/debug/debug.h
	(_Safe_iterator<>(const _Safe_iterator<_MutableIterator,>& __x)):
	Compare __x base iterator with a default initialized iterator of the
	same type.

From-SVN: r261831
2018-06-21 05:36:48 +00:00
GCC Administrator a788a23c33 Daily bump.
From-SVN: r261830
2018-06-21 00:16:46 +00:00
Than McIntosh 1f3fa52553 re PR libgcc/86213 (-fsplit-stack runtime may clobber SSE input param reg)
libgcc/:
	PR libgcc/86213
	* generic-morestack.c (allocate_segment): Move calls to getenv and
	getpagesize to __morestack_load_mmap.
	(__morestack_load_mmap) Initialize static_pagesize and
	use_guard_page here so as to avoid clobbering SSE regs during a
	__morestack call.
gcc/testsuite/:
	* gcc.dg/split-8.c: New.

From-SVN: r261823
2018-06-20 21:11:23 +00:00
Kelvin Nilsen d8e7bf49a8 rs6000-c.c (altivec_overloaded_builtins): Change behavior of vec_packsu (vector unsigned long long...
gcc/ChangeLog:

2018-06-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Change
	behavior of vec_packsu (vector unsigned long long, vector unsigned
	long long) to match behavior of vec_packs with same signature.

gcc/testsuite/ChangeLog:

2018-06-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* gcc.target/powerpc/builtins-1.c: Adjust dg directives to scan
	for vpkudus in place of vpksdus.
	* gcc.target/powerpc/builtins-3-p8.c: Likewise.

From-SVN: r261819
2018-06-20 20:06:51 +00:00
Jonathan Wakely e70359b3de PR libstdc++/70966 make pmr::new_delete_resource() immortal
Construct the program-wide resource objects using placement new. This
means they have dynamic storage duration and won't be destroyed during
termination.

	PR libstdc++/70966
	* include/experimental/memory_resource (__resource_adaptor_imp): Add
	static assertions to enforce requirements on pointer types.
	(__resource_adaptor_imp::get_allocator()): Add noexcept.
	(new_delete_resource, null_memory_resource): Return address of an
	object with dynamic storage duration.
	(__null_memory_resource): Remove.
	* testsuite/experimental/memory_resource/70966.cc: New.

From-SVN: r261818
2018-06-20 20:34:53 +01:00
Nathan Sidwell c145665684 [PR c++/85634] Fix tsubst ICE
https://gcc.gnu.org/ml/gcc-patches/2018-06/msg01274.html
	PR c++/85634
	* friend.c (add_friend): Keep lookup sets of tempate sets.

	PR c++/85634
	* g++.dg/lookup/pr85634-2.C: New.

From-SVN: r261817
2018-06-20 19:22:53 +00:00
Paolo Carlini f2cb6e64c9 decl.c (grokfndecl): Add const cp_decl_specifier_seq* parameter...
/cp
2018-06-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (grokfndecl): Add const cp_decl_specifier_seq* parameter;
	tidy handling of a null location_t argument; use proper location
	information in a few additional error messages.
	(grokdeclarator): Update calls.

/testsuite
2018-06-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/template/friend65.C: New.
	* g++.dg/cpp0x/main1.C: Likewise.
	* g++.dg/other/main2.C: Likewise.
	* g++.dg/other/main3.C: Likewise.
	* g++.dg/template/friend42.C: Test location too.
	* g++.dg/concepts/decl-diagnose.C: Likewise.
	* g++.dg/warn/main-2.C: Update.

From-SVN: r261816
2018-06-20 19:07:37 +00:00
Chung-Lin Tang 829c6349e9 Update OpenACC data clause semantics to the 2.5 behavior
gcc/c-family/
	* c-pragma.h (enum pragma_omp_clause): Add
	PRAGMA_OACC_CLAUSE_{FINALIZE,IF_PRESENT}. Remove
	PRAGMA_OACC_CLAUSE_PRESENT_OR_{COPY,COPYIN,COPYOUT,CREATE}.

	gcc/c/
	* c-parser.c (c_parser_omp_clause_name): Add support for finalize
	and if_present. Make present_or_{copy,copyin,copyout,create} aliases
	to their non-present_or_* counterparts. Make 'self' an alias to
	PRAGMA_OACC_CLAUSE_HOST.
	(c_parser_oacc_data_clause): Update GOMP mappings for
	PRAGMA_OACC_CLAUSE_{COPY,COPYIN,COPYOUT,CREATE,DELETE}. Remove
	PRAGMA_OACC_CLAUSE_{SELF,PRESENT_OR_*}.
	(c_parser_oacc_all_clauses): Handle finalize and if_present clauses.
	Remove support for present_or_* clauses.
	(OACC_KERNELS_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
	(OACC_PARALLEL_CLAUSE_MASK): Likewise.
	(OACC_DECLARE_CLAUSE_MASK): Likewise.
	(OACC_DATA_CLAUSE_MASK): Likewise.
	(OACC_ENTER_DATA_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
	(OACC_EXIT_DATA_CLAUSE_MASK): Add FINALIZE clause.
	(OACC_UPDATE_CLAUSE_MASK): Remove SELF, add IF_PRESENT.
	(c_parser_oacc_declare): Remove PRESENT_OR_* clauses.
	* c-typeck.c (c_finish_omp_clauses): Handle IF_PRESENT and FINALIZE.

	gcc/cp/
	* parser.c (cp_parser_omp_clause_name): Add support for finalize
	and if_present. Make present_or_{copy,copyin,copyout,create} aliases
	to their non-present_or_* counterparts. Make 'self' an alias to
	PRAGMA_OACC_CLAUSE_HOST.
	(cp_parser_oacc_data_clause): Update GOMP mappings for
	PRAGMA_OACC_CLAUSE_{COPY,COPYIN,COPYOUT,CREATE,DELETE}. Remove
	PRAGMA_OACC_CLAUSE_{SELF,PRESENT_OR_*}.
	(cp_parser_oacc_all_clauses): Handle finalize and if_present clauses.
	Remove support for present_or_* clauses.
	(OACC_KERNELS_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
	(OACC_PARALLEL_CLAUSE_MASK): Likewise.
	(OACC_DECLARE_CLAUSE_MASK): Likewise.
	(OACC_DATA_CLAUSE_MASK): Likewise.
	(OACC_ENTER_DATA_CLAUSE_MASK): Remove PRESENT_OR_* clauses.
	(OACC_EXIT_DATA_CLAUSE_MASK): Add FINALIZE clause.
	(OACC_UPDATE_CLAUSE_MASK): Remove SELF, add IF_PRESENT.
	(cp_parser_oacc_declare): Remove PRESENT_OR_* clauses.
	* pt.c (tsubst_omp_clauses): Handle IF_PRESENT and FINALIZE.
	* semantics.c (finish_omp_clauses): Handle IF_PRESENT and FINALIZE.

	gcc/fortran/
	* gfortran.h (gfc_omp_clauses): Add unsigned if_present, finalize
	bitfields.
	* openmp.c (enum omp_mask2): Remove OMP_CLAUSE_PRESENT_OR_*. Add
	OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
	(gfc_match_omp_clauses): Update handling of copy, copyin, copyout,
	create, deviceptr, present_of_*. Add support for finalize and
	if_present.
	(OACC_PARALLEL_CLAUSES): Remove PRESENT_OR_* clauses.
	(OACC_KERNELS_CLAUSES): Likewise.
	(OACC_DATA_CLAUSES): Likewise.
	(OACC_DECLARE_CLAUSES): Likewise.
	(OACC_UPDATE_CLAUSES): Add IF_PRESENT clause.
	(OACC_ENTER_DATA_CLAUSES): Remove PRESENT_OR_* clauses.
	(OACC_EXIT_DATA_CLAUSES): Add FINALIZE clause.
	(gfc_match_oacc_declare): Update to OpenACC 2.5 semantics.
	* trans-openmp.c (gfc_trans_omp_clauses): Add support for IF_PRESENT
	and FINALIZE.

	gcc/
	* gimplify.c (gimplify_scan_omp_clauses): Add support for
	OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
	(gimplify_adjust_omp_clauses): Likewise.
	(gimplify_oacc_declare_1): Add support for GOMP_MAP_RELEASE, remove
	support for GOMP_MAP_FORCE_{ALLOC,TO,FROM,TOFROM}.
	(gimplify_omp_target_update): Update handling of acc update and
	enter/exit data.
	* omp-low.c (install_var_field): Remove unused parameter
	base_pointers_restrict.
	(scan_sharing_clauses): Remove base_pointers_restrict parameter.
	Update call to install_var_field. Handle OMP_CLAUSE_{IF_PRESENT,
	FINALIZE}
	(omp_target_base_pointers_restrict_p): Delete.
	(scan_omp_target): Update call to scan_sharing_clauses.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_{IF_PRESENT,
	FINALIZE}.
	* tree-nested.c (convert_nonlocal_omp_clauses): Handle
	OMP_CLAUSE_{IF_PRESENT,FINALIZE}.
	(convert_local_omp_clauses): Likewise.
	* tree-pretty-print.c (dump_omp_clause): Likewise.
	* tree.c (omp_clause_num_ops): Add entries for 	OMP_CLAUSE_{IF_PRESENT,
	FINALIZE}.
	(omp_clause_code_name): Likewise.

	gcc/testsuite/
	* c-c++-common/goacc/declare-1.c: Update test case to utilize OpenACC
	2.5 data clause semantics.
	* c-c++-common/goacc/declare-2.c: Likewise.
	* c-c++-common/goacc/default-4.c: Likewise.
	* c-c++-common/goacc/finalize-1.c: New test.
	* c-c++-common/goacc/kernels-alias-2.c: Update test case to utilize
	OpenACC 2.5 data clause semantics.
	* c-c++-common/goacc/kernels-alias.c: Likewise.
	* c-c++-common/goacc/routine-5.c: Likewise.
	* c-c++-common/goacc/update-if_present-1.c: New test.
	* c-c++-common/goacc/update-if_present-2.c: New test.
	* g++.dg/goacc/template.C: Update test case to utilize OpenACC
	2.5 data clause semantics.
	* gfortran.dg/goacc/combined-directives.f90: Likewise.
	* gfortran.dg/goacc/data-tree.f95: Likewise.
	* gfortran.dg/goacc/declare-2.f95: Likewise.
	* gfortran.dg/goacc/default-4.f: Likewise.
	* gfortran.dg/goacc/enter-exit-data.f95: Likewise.
	* gfortran.dg/goacc/finalize-1.f: New test.
	* gfortran.dg/goacc/kernels-alias-2.f95: Update test case to utilize
	OpenACC 2.5 data clause semantics.
	* gfortran.dg/goacc/kernels-alias.f95: Likewise.
	* gfortran.dg/goacc/kernels-tree.f95: Likewise.
	* gfortran.dg/goacc/nested-function-1.f90: Likewise.
	* gfortran.dg/goacc/parallel-tree.f95: Likewise.
	* gfortran.dg/goacc/reduction-promotions.f90: Likewise.
	* gfortran.dg/goacc/update-if_present-1.f90: New test.
	* gfortran.dg/goacc/update-if_present-2.f90: New test.

	libgomp/
	* libgomp.h (struct splay_tree_key_s): Add dynamic_refcount member.
	(gomp_acc_remove_pointer): Update declaration.
	(gomp_acc_declare_allocate): Declare.
	(gomp_remove_var): Declare.
	* libgomp.map (OACC_2.5): Define.
	* oacc-mem.c (acc_map_data): Update refcount.
	(acc_unmap_data): Likewise.
	(present_create_copy): Likewise.
	(acc_create): Add FLAG_PRESENT when calling present_create_copy.
	(acc_copyin): Likewise.
	(FLAG_FINALIZE): Define.
	(delete_copyout): Update dynamic refcounts, add support for FINALIZE.
	(acc_delete_finalize): New function.
	(acc_delete_finalize_async): New function.
	(acc_copyout_finalize): New function.
	(acc_copyout_finalize_async): New function.
	(gomp_acc_insert_pointer): Update refcounts.
	(gomp_acc_remove_pointer): Return if data is not present on the
	accelerator.
	* oacc-parallel.c (find_pset): Rename to find_pointer.
	(find_pointer): Add support for GOMP_MAP_POINTER.
	(handle_ftn_pointers): New function.
	(GOACC_parallel_keyed): Update refcounts of variables.
	(GOACC_enter_exit_data): Add support for finalized data mappings.
	Add support for GOMP_MAP_{TO,ALLOC,RELESE,FROM}. Update handling
	of fortran arrays.
	(GOACC_update): Add support for GOMP_MAP_{ALWAYS_POINTER,TO,FROM}.
	(GOACC_declare): Add support for GOMP_MAP_RELEASE, remove support
	for GOMP_MAP_FORCE_FROM.
	* openacc.f90 (module openacc_internal): Add
	acc_copyout_finalize_{32_h,64_h,array_h,_l}, and
	acc_delete_finalize_{32_h,64_h,array_h,_l}. Add interfaces for
	acc_copyout_finalize and acc_delete_finalize.
	(acc_copyout_finalize_32_h): New subroutine.
	(acc_copyout_finalize_64_h): New subroutine.
	(acc_copyout_finalize_array_h): New subroutine.
	(acc_delete_finalize_32_h): New subroutine.
	(acc_delete_finalize_64_h): New subroutine.
	(acc_delete_finalize_array_h): New subroutine.
	* openacc.h (acc_copyout_finalize): Declare.
	(acc_copyout_finalize_async): Declare.
	(acc_delete_finalize): Declare.
	(acc_delete_finalize_async): Declare.
	* openacc_lib.h (acc_copyout_finalize): New interface.
	(acc_delete_finalize): New interface.
	* target.c (gomp_map_vars): Update dynamic_refcount.
	(gomp_remove_var): New function.
	(gomp_unmap_vars): Use it.
	(gomp_unload_image_from_device): Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-1.c: Update test
	case to utilize OpenACC 2.5 data clause semantics.
	* testsuite/libgomp.oacc-c-c++-common/data-already-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-6.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-7.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-8.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-32.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-83.c: Likewise.
	* testsuite/libgomp.oacc-fortran/data-5.f90: New test.
	* testsuite/libgomp.oacc-fortran/data-already-1.f: Update test case to
	utilize OpenACC 2.5 data clause semantics.
	* testsuite/libgomp.oacc-fortran/data-already-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-3.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-4.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-5.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-6.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-7.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-8.f: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-32-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/lib-32-2.f: Likewise.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>

From-SVN: r261813
2018-06-20 09:35:15 -07:00
Jakub Jelinek f41b7612a9 re PR c++/86210 (Missing -Wnonnull warning for function defined in the same TU)
PR c++/86210
	* c-common.c (check_nonnull_arg): Use fold_for_warn.  Adjust obsolete
	comment.

	* g++.dg/warn/Wnonnull4.C: New test.

From-SVN: r261811
2018-06-20 18:07:21 +02:00
Jonathan Wakely d9addf3344 Add testcase accidentally not committed earlier
* testsuite/20_util/duration/arithmetic/dr3050.cc: Add new test
	missed from recent commit.

From-SVN: r261810
2018-06-20 16:54:57 +01:00
Marek Polacek e28fadbc06 re PR c++/86240 (ice: unexpected expression absu_expr)
PR c++/86240
	* constexpr.c (cxx_eval_constant_expression): Handle ABSU_EXPR.
	(fold_simple_1): Likewise.
	* error.c (dump_expr): Likewise.

	* g++.dg/pr86240.C: New test.

From-SVN: r261809
2018-06-20 15:46:02 +00:00
Jakub Jelinek 125fe9abf3 re PR debug/86194 (ICE: SIGSEGV in avoid_constant_pool_reference (simplify-rtx.c:215) with -O -g -mavx512bw)
PR debug/86194
	* var-tracking.c (use_narrower_mode_test): Check if shift amount can
	be narrowed.

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

From-SVN: r261807
2018-06-20 16:51:04 +02:00
Jakub Jelinek c81a5aecc5 re PR tree-optimization/86231 (vrp_meet causes wrong-code)
PR tree-optimization/86231
	* tree-vrp.c (union_ranges): For (  [  )  ] or (   )[   ] range and
	anti-range don't overwrite *vr0min before using it to compute *vr0max.

	* gcc.dg/tree-ssa/vrp119.c: New test.
	* gcc.c-torture/execute/pr86231.c: New test.

From-SVN: r261805
2018-06-20 16:47:28 +02:00
Tom de Vries 60f02f9021 Generate correctly typed compare in canonicalize_loop_ivs
2018-06-20  Tom de Vries  <tdevries@suse.de>

	PR tree-optimization/86097
	* tree-ssa-loop-manip.c (canonicalize_loop_ivs): Also convert *nit to
	iv type if signedness of iv type is not the same as that of *nit.

	* gcc.dg/autopar/pr86097.c: New test.

From-SVN: r261804
2018-06-20 14:44:45 +00:00
Jakub Jelinek d53e8ef490 cfgrtl.c (rtl_verify_edges): Formatting fix.
* cfgrtl.c (rtl_verify_edges): Formatting fix.  If bb->preds has any
	EDGE_EH edges, verify they are all EDGE_EH.

From-SVN: r261803
2018-06-20 16:42:19 +02:00
Nathan Sidwell 335a120f7f [PR c++/85634] Fix tsubst ICE
https://gcc.gnu.org/ml/gcc-patches/2018-06/msg01237.html
	PR c++/85634
	* cp-tree.h (lookup_keep): Drop KEEP parm.
	(lookup_list_keep): Delete.
	(maybe_get_fns): Declare.
	* parser.c (cp_parser_primary_expression): Call lookup_keep here.
	(cp_parser_template_id): Not here ...
	* decl.c (cp_finish_decl): ... nor here ...
	* init.c (build_raw_new_expr): ... nor here ...
	* pt.c (process_template_parm): ... nor here ...
	* semantics.c (perform_koenig_lookup): Call lookup_keep.
	(finish_call_expr): Not here.
	* tree.c (ovl_cache): Delete.
	(ovl_make, ovl_copy): No cache.
	(lookup_keep): Always keep.
	(lookup_list_keep): Delete.
	(maybe_get_fns): New, broken out of ...
	(get_fns): ... here.  Call it.
	(built_min_nt_loc, build_min, build_min_non_dep): Drop lookup_keep.
	(build_min_nt_call_vec): Likewise.

	PR c++/85634
	* g++.dg/lookup/pr85634.C: New.

From-SVN: r261802
2018-06-20 14:34:06 +00:00