Commit Graph

153558 Commits

Author SHA1 Message Date
Thomas Schwinge b0f271ce56 [PR middle-end/69921] Use "oacc kernels parallelized" attribute for parallelized OpenACC kernels
gcc/
	PR middle-end/69921
	* tree-parloops.c (create_parallel_loop): Set "oacc kernels
	parallelized" attribute for parallelized OpenACC kernels.
	* omp-offload.c (execute_oacc_device_lower): Use it.
	gcc/testsuite/
	* c-c++-common/goacc/classify-kernels-unparallelized.c: Adjust.
	* c-c++-common/goacc/classify-kernels.c: Likewise.
	* c-c++-common/goacc/kernels-counter-vars-function-scope.c:
	Likewise.
	* c-c++-common/goacc/kernels-double-reduction-n.c: Likewise.
	* c-c++-common/goacc/kernels-double-reduction.c: Likewise.
	* c-c++-common/goacc/kernels-loop-2.c: Likewise.
	* c-c++-common/goacc/kernels-loop-3.c: Likewise.
	* c-c++-common/goacc/kernels-loop-g.c: Likewise.
	* c-c++-common/goacc/kernels-loop-mod-not-zero.c: Likewise.
	* c-c++-common/goacc/kernels-loop-n.c: Likewise.
	* c-c++-common/goacc/kernels-loop-nest.c: Likewise.
	* c-c++-common/goacc/kernels-loop.c: Likewise.
	* c-c++-common/goacc/kernels-one-counter-var.c: Likewise.
	* c-c++-common/goacc/kernels-reduction.c: Likewise.
	* gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise.
	* gfortran.dg/goacc/classify-kernels.f95: Likewise.
	* gfortran.dg/goacc/kernels-loop-2.f95: Likewise.
	* gfortran.dg/goacc/kernels-loop-data-2.f95: Likewise.
	* gfortran.dg/goacc/kernels-loop-data-enter-exit-2.f95: Likewise.
	* gfortran.dg/goacc/kernels-loop-data-enter-exit.f95: Likewise.
	* gfortran.dg/goacc/kernels-loop-data-update.f95: Likewise.
	* gfortran.dg/goacc/kernels-loop-data.f95: Likewise.
	* gfortran.dg/goacc/kernels-loop-n.f95: Likewise.
	* gfortran.dg/goacc/kernels-loop.f95: Likewise.

From-SVN: r247957
2017-05-12 11:18:34 +02:00
Thomas Schwinge 2565163443 Use "oacc kernels" attribute for OpenACC kernels
gcc/
	* omp-expand.c (expand_omp_target) <GF_OMP_TARGET_KIND_OACC_KERNELS>:
	Set "oacc kernels" attribute.
	* omp-general.c (oacc_set_fn_attrib): Remove is_kernel formal
	parameter.  Adjust all users.
	(oacc_fn_attrib_kernels_p): Remove function.
	* omp-offload.c (execute_oacc_device_lower): Look for "oacc
	kernels" attribute instead of calling oacc_fn_attrib_kernels_p.
	* tree-ssa-loop.c (gate_oacc_kernels): Likewise.
	* tree-parloops.c (create_parallel_loop): If oacc_kernels_p,
	assert "oacc kernels" attribute is set.
	gcc/testsuite/
	* c-c++-common/goacc/classify-kernels-unparallelized.c: Adjust.
	* c-c++-common/goacc/classify-kernels.c: Likewise.
	* c-c++-common/goacc/classify-parallel.c: Likewise.
	* c-c++-common/goacc/classify-routine.c: Likewise.
	* gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise.
	* gfortran.dg/goacc/classify-kernels.f95: Likewise.
	* gfortran.dg/goacc/classify-parallel.f95: Likewise.
	* gfortran.dg/goacc/classify-routine.f95: Likewise.

From-SVN: r247955
2017-05-12 11:02:55 +02:00
Thomas Schwinge ee58b02f11 Test cases to check OpenACC offloaded function's attributes and classification
gcc/testsuite/
	* c-c++-common/goacc/classify-kernels-unparallelized.c: New file.
	* c-c++-common/goacc/classify-kernels.c: Likewise.
	* c-c++-common/goacc/classify-parallel.c: Likewise.
	* c-c++-common/goacc/classify-routine.c: Likewise.
	* gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise.
	* gfortran.dg/goacc/classify-kernels.f95: Likewise.
	* gfortran.dg/goacc/classify-parallel.f95: Likewise.
	* gfortran.dg/goacc/classify-routine.f95: Likewise.

From-SVN: r247953
2017-05-12 10:42:31 +02:00
Thomas Schwinge 9ef6dfbaf2 Typo fixes for "Don't assume __secure_getenv is available"
libgfortran/
	* runtime/environ.c (weak_secure_getenv): Fix "__secure_gettime"
	vs. "__secure_getenv" typo.
	(secure_getenv): Fix "HAVE__SECURE_GETENV"
	vs. "HAVE___SECURE_GETENV" typo.

From-SVN: r247952
2017-05-12 09:56:41 +02:00
Ian Lance Taylor fa846918fc mksigtab.sh: recurse once when adding signals to SIGLIST
On MIPS, SIGABRT is defined like this:
     #define SIGIOT   6
     #define SIGABRT  SIGIOT
    
    This breaks addsig which tries to append __SIGIOT_ to SIGLIST. Signal
    number 6 is later added to the output and go complains about a
    duplicate signal number.
    
    Fix by recursing once when obtaining the signal number from
    gen-sysinfo.go if the signal is defined as an alias of another signal.
    Also modify the sed expression to 's/.* = //' which is equivalent to
    the original expression but is less misleading given that it might not
    match a number.
    
    Reviewed-on: https://go-review.googlesource.com/43252

From-SVN: r247948
2017-05-12 01:09:42 +00:00
Ian Lance Taylor b3a7fdc3ea os: use opendir64 and closedir64 on AIX
When using readdir64 on AIX, we must also use
    opendir64 and closedir64.
    
    Issue golang/go#19200
    
    Reviewed-on: https://go-review.googlesource.com/43251

From-SVN: r247947
2017-05-12 00:59:15 +00:00
Nathan Sidwell 2d82ec25dc * lib/gcc-dg.exp (schedule-cleanups): Add lang dump capability.
From-SVN: r247946
2017-05-12 00:28:44 +00:00
GCC Administrator c7145711b8 Daily bump.
From-SVN: r247945
2017-05-12 00:16:29 +00:00
Ian Lance Taylor be18b176b7 re PR go/64238 (ICE in get_partitioning_class, at symtab.c:1775)
PR go/64238
	* go-gcc.cc (Gcc_backend::implicit_variable_reference): Set
	DECL_EXTERNAL, clear TREE_STATIC.

From-SVN: r247937
2017-05-11 23:52:54 +00:00
Carl Love b403beb80a rs6000-c: Add support for built-in functions vector unsigned char vec_popcnt (vector...
gcc/ChangeLog:

2017-05-11  Carl Love  <cel@us.ibm.com>

	* config/rs6000/rs6000-c: Add support for built-in functions
	vector unsigned char vec_popcnt (vector signed char)
	vector unsigned char vec_popcnt (vector unsigned char)
	vector unsigned short vec_popcnt (vector signed short)
	vector unsigned short vec_popcnt (vector unsigned short)
	vector unsigned int vec_popcnt (vector signed int)
	vector unsigned int vec_popcnt (vector unsigned int)
	vector unsigned long long vec_popcnt (vector signed long long)
	vector unsigned long long vec_popcnt (vector unsigned long long)
	vector signed long long vec_slo (vector signed long long,
                                         vector signed char)
	vector signed long long vec_slo (vector signed long long,
                                         vector unsigned char)
	vector unsigned long long vec_slo (vector unsigned long long,
                                           vector signed char)
	vector unsigned long long vec_slo (vector unsigned long long,
                                           vector unsigned char)
	* config/rs6000/rs6000-builtin.def: Add definitions for VPOPCNTUB,
	VPOPCNTUH, VPOPCNTUW, and VPOPCNTUD overloads.
	* config/rs6000/altivec.h: Add define for vec_popcnt, vec_popcntb,
	vec_popcnth, vec_popcntw and vec_popcntd built-in functions.
	* doc/extend.texi: Update the built-in documentation file for the
	new built-in functions.


gcc/testsuite/ChangeLog:

2017-05-11  Carl Love  <cel@us.ibm.com>

	* gcc.target/powerpc/builtins-3-p8.c: Add tests for the new built-ins
	to the test suite file.
	* gcc.target/powerpc/builtins-3.c: Add tests for the new built-ins
	to the test suite file.

From-SVN: r247933
2017-05-11 22:10:10 +00:00
Michael Meissner 1b062c1ac1 attribs.h (sorted_attr_string): Move machine independent functions for target clone support from the i386 port...
2017-05-11  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* attribs.h (sorted_attr_string): Move machine independent
	functions for target clone support from the i386 port to common
	code.  Rename ix86_function_versions to common_function_versions.
	Rename make_name to make_unique_name.
	(common_function_versions): Likewise.
	(make_unique_name): Likewise.
	(make_dispatcher_decl): Likewise.
	(is_function_default_version): Likewise.
	* attribs.c (attr_strcmp): Likewise.
	(sorted_attr_string): Likewise.
	(common_function_versions): Likewise.
	(make_unique_name): Likewise.
	(make_dispatcher_decl): Likewise.
	(is_function_default_version): Likewise.
	* config/i386/i386.c (attr_strcmp): Likewise.
	(sorted_attr_string): Likewise.
	(ix86_function_versions): Likewise.
	(make_name): Likewise.
	(make_dispatcher_decl): Likewise.
	(is_function_default_version): Likewise.
	(TARGET_OPTION_FUNCTION_VERSIONS): Update target function hook.

From-SVN: r247932
2017-05-11 21:51:07 +00:00
Ian Lance Taylor 3619ab8bd4 runtime: fix isSystemGoroutine for gccgo
The gc toolchain decides whether a goroutine is a system goroutine by
    comparing startpc to a list of saved special PCs.  In gccgo that
    approach does not work as startpc is often a thunk that invokes the
    real function with arguments, so the thunk address never matches the
    saved special PCs.
    
    This patch fixes gccgo's understanding of system goroutines.  Since
    there are only a limited number of them, we simply change each one to
    mark itself as special.
    
    This fixes stack dumps and functions like runtime.NumGoroutine to
    behave more like gc.  It also fixes the goprint test in the gc
    testsuite.
    
    Reviewed-on: https://go-review.googlesource.com/43156

From-SVN: r247931
2017-05-11 20:55:41 +00:00
Jerry DeLisle 628c06d6bc re PR fortran/78659 ([F03] Spurious "requires DTIO" reported against namelist statement)
2017-05-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/78659
	* io.c (dtio_procs_present): Add new function to check for DTIO
	procedures relative to I/O statement READ or WRITE.
	(gfc_resolve_dt): Add namelist checks using the new function.
	* resolve.c (dtio_procs_present): Remove function and related
	namelist checks. (resolve_fl_namelist): Add check specific to
	Fortran 95 restriction on namelist objects.

	* gfortran.dg/namelist_91.f90: New test.
	* gfortran.dg/namelist_92.f90: New test.
	* gfortran.dg/namelist_93.f90: New test.
	* gfortran.dg/namelist_94.f90: New test.

From-SVN: r247930
2017-05-11 20:40:49 +00:00
François Dumont fee84d551f 2017-05-11 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_tree.h [_GLIBCXX_INLINE_VERSION]
	(_Rb_tree_impl<>): Remove _Is_pod_comparator
	template parameter.

From-SVN: r247929
2017-05-11 20:30:44 +00:00
Bill Schmidt 1bea0f2663 re PR target/80695 (gratuitous use of stxvx to store multiple pointers)
[gcc]

2017-05-11  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/80695
	* config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost):
	Account for direct move costs for vec_construct of integer
	vectors.

[gcc/testsuite]

2017-05-11  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/80695
	* gcc.target/powerpc/pr80695-p8.c: New file.
	* gcc.target/powerpc/pr80695-p9.c: New file.

From-SVN: r247928
2017-05-11 20:16:02 +00:00
Janne Blomqvist d86e68e207 Don't assume __secure_getenv is available
Glibc 2.17 made __secure_getenv an officially supported function, and
renamed it secure_getenv. The libgfortran configure has checked for
both of these, per
https://sourceware.org/glibc/wiki/Tips_and_Tricks/secure_getenv.

Unfortunately, while the dynamical library (libc.so) retains the
__secure_getenv symbol for backwards compatibility, the static library
(libc.a) does not. This means that a libgfortran.a compiled against an
older glibc will not work if one tries to link against a newer
libc.a. This creates problems for providing gfortran binary
distributions that work on as many target systems as possible.

Thus, retain the support for __secure_getenv but call it only via a
weak reference.

Regtested on x86_64-pc-linux-gnu.

2017-05-11  Janne Blomqvist  <jb@gcc.gnu.org>

	* libgfortran.h: HAVE_SECURE_GETENV: Don't check
	HAVE___SECURE_GETENV.
	* environ/runtime.c (secure_getenv): Use __secure_getenv via a
        weak reference.

From-SVN: r247927
2017-05-11 23:04:53 +03:00
François Dumont ea594612f0 2017-05-11 François Dumont <fdumont@gcc.gnu.org>
* include/debug/safe_container.h [_GLIBCXX_USE_CXX11_ABI]
	(_Safe_container<>): Remove _IsCxx11AllocatorAware template parameter.
	* include/debug/string: Adapt.

From-SVN: r247926
2017-05-11 20:03:47 +00:00
François Dumont dc4dd7f63f 2017-05-11 François Dumont <fdumont@gcc.gnu.org>
* include/debug/formatter.h [_GLIBCXX_INLINE_VERSION]
	(__gnu_debug::_Error_formatter::_Parameter::_M_print_field): Remove.
	(__gnu_debug::_Error_formatter::_Parameter::_M_print_description):
	Remove.
	(__gnu_debug::_Error_formatter::_M_format_word): Remove.
	(__gnu_debug::_Error_formatter::_M_print_word): Remove.
	(__gnu_debug::_Error_formatter::_M_print_string): Remove.
	(__gnu_debug::_Error_formatter::_M_get_max_length): Remove.
	* src/c++11/debug.cc: Adapt.
	* config/abi/pre/gnu-versioned-namespace.ver: Adapt.

From-SVN: r247925
2017-05-11 19:49:26 +00:00
Nathan Sidwell ce9750d5ae Missing Changelog
Missing Changelog
	* libcp1plugin.cc (safe_pushdecl_maybe_friend): Call pushdecl.

From-SVN: r247924
2017-05-11 19:15:59 +00:00
Nathan Sidwell 505dd180fa cp-lang.c (get_global_decls, [...]): Move to ...
* cp-lang.c (get_global_decls, cxx_pushdecl, LANG_HOOK_GETDECLS)
	LANG_HOOKS_PUSHDECL): Move to ...
	* cp-objcp-common.c (cp_get_global_decls, cp_pushdec)
	LANG_HOOK_DECLS, LANG_HOOKS_PUSHDECL): ... here.
	* cp-objcp-common.h (cp_get_global_decls, cp_pushdecl): Declare.
((--This line, and those below, will be ignored--

M    cp/ChangeLog
M    cp/cp-lang.c
M    cp/cp-objcp-common.c
M    cp/cp-objcp-common.h

From-SVN: r247923
2017-05-11 19:09:51 +00:00
Nathan Sidwell 430af3cf5a * libcp1plugin.cc (plugin_build_decl): Adjust add_method call.
From-SVN: r247922
2017-05-11 18:48:55 +00:00
Uros Bizjak 7c85c9fec4 re PR target/80706 (peephole2 uses uninitialized stack variables on i686)
PR target/80706
	* config/i386/sync.md (UNSPEC_LDX_ATOMIC): New unspec.
	(UNSPEC_STX_ATOMIC): Ditto.
	(loaddi_via_sse): New insn.
	(storedi_via_sse): Ditto.
	(atomic_loaddi_fpu): Emit loaddi_via_sse and storedi_via_sse.
	Update corresponding peephole2 patterns.
	(atomic_storedi_fpu): Ditto.

testsuite/ChangeLog:

	PR target/80706
	* gcc.target/i386/pr80706.c: New test.

From-SVN: r247921
2017-05-11 20:12:25 +02:00
Julia Koval d7a33a4cb0 * config/i386/avx512fintrin.h (_mm_mask_rsqrt14_sd)
(_mm_maskz_rsqrt14_sd, _mm_mask_rsqrt14_ss, _mm_maskz_rsqrt14_ss):
	New intrinsics.
	* config/i386/i386-builtin.def (__builtin_ia32_rsqrt14sd_mask)
	(__builtin_ia32_rsqrt14ss_mask): New builtins.
	* config/i386/sse.md (rsqrt14_<mode>_mask): New pattern.

testsuite/ChangeLog:

	* gcc.target/i386/avx512f-vrsqrt14sd-1.c: Test new intrinsics.
	* gcc.target/i386/avx512f-vrsqrt14sd-2.c: Ditto.
	* gcc.target/i386/avx512f-vrsqrt14ss-1.c: Ditto.
	* gcc.target/i386/avx512f-vrsqrt14ss-2.c: Ditto.

From-SVN: r247920
2017-05-11 20:01:12 +02:00
Nathan Sidwell 31cf88b660 * graphite-poly.c: Include dumpfile.h.
From-SVN: r247919
2017-05-11 17:43:52 +00:00
Nathan Sidwell 4f15a5da6f name-lookup.h (pushdecl): Add default friend parm.
* name-lookup.h (pushdecl): Add default friend parm.
	(pushdecl_maybe_friend): Delete.
	(pushdecl_top_level): Add default friend parm.
	(pushdecl_top_level_maybe_friend): Delete.
	* name-lookup.c (pushdecl_maybe_friend): Delete.
	(pushdecl): Add is_friend parm.
	(pushdecl_top_level): Add is friend_parm.
	(pushdecl_top_level_maybe_friend, pushdecl_top_level_1): Delete.
	(pushdecl_top_level_and_finish): Do pushing and finishing
	directly.
	* friend.c (do_friend): Adjust.
	* pt.c (tsubst_friend_class): Adjust.

From-SVN: r247918
2017-05-11 17:38:55 +00:00
Paolo Carlini 59fbddcfff re PR c++/70538 (ICE on a deprecated access declaration in instantiate_template_1, at cp/pt.c:17310)
2017-05-11  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/70538
	* g++.dg/cpp0x/pr70538.C: New.

From-SVN: r247917
2017-05-11 17:13:42 +00:00
Nathan Sidwell c24e924f92 dumpfle.h (dump_function): Declare here ...
* dumpfle.h (dump_function): Declare here ...
	* tree-dump.h (dump_function): ... not here.
	* dumpfile.c: #include tree-cfg.h.
	(dump_function): Move here from ...
	* tree-dump.c (dump_function): ... here.
	* gimplify.c: #include splay-tree.h, not tree-dump.h.
	* graphite-poly.c: Don't include tree-dump.h.
	* cgraphclones.c: Include dumpfile.h not tree-dump.h.
	* print-tree.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-nested.c: Likewise.

	c/
	* gimple-parser.c: Don't #include tree-dump.h.

	fortran/
	* trans-decl.c: Include dumpfile.h not tree-dump.h,

From-SVN: r247916
2017-05-11 15:48:51 +00:00
Nathan Sidwell 2e3757e78a Revert pushdecl_top_level_and_finish name change.
* name-lookup.h (pushdecl_top_level_and_finish): Resurrect old
	name.
	* name-lookup.c (pushdecl_top_level_and_finish): Likewise.
	* decl.c (cp_make_fname_decl): Adjust.
	* decl2.c (get_guard, handle_tls_init):  Adjust.
	* rtti.c (get_tinfo_decl, tinfo_base_init):  Adjust.

From-SVN: r247915
2017-05-11 15:46:48 +00:00
Uros Bizjak cc09ff603b pr22152.c: Fix undefined testcase.
* gcc.target/i386/pr22152.c: Fix undefined testcase.  Remove
	unnecessary loop.  Run on 32-bit targets only.
	(dg-options): Remove -fno-tree-sink.

From-SVN: r247914
2017-05-11 17:41:50 +02:00
Steven Munroe 75ad901a7a As I will be working on X86 intrinsic equivalents for PowerPC64LE
adding myself to Write After Approval list.

2017-05-11  Steven Munroe  <munroesj@gcc.gnu.org>

	* MAINTAINERS: Add myself to Write After Approval section.

From-SVN: r247913
2017-05-11 15:41:24 +00:00
Jonathan Wakely 395ec8f30c Fix ViewCVS URLs in libstdc++ manual
* doc/xml/manual/allocator.xml: Fix ViewCVS URLs.
	* doc/xml/manual/mt_allocator.xml: Likewise.
	* doc/html/*: Regenerate.

From-SVN: r247911
2017-05-11 16:01:10 +01:00
Nathan Sidwell c8634a1a24 name-lookup.c (pushdecl_outermost_localscope): Always conditionally stop timer.
* name-lookup.c (pushdecl_outermost_localscope): Always
	conditionally stop timer.

From-SVN: r247910
2017-05-11 14:51:07 +00:00
Nathan Sidwell c443f3d51e decl.c (xref_tag_1): Don't frob ts_lambda scope here.
* decl.c (xref_tag_1): Don't frob ts_lambda scope here.
	* name-lookup.c (pushtag_1): Deal with ts_lambda scope.

From-SVN: r247909
2017-05-11 14:40:28 +00:00
Nathan Sidwell 2cd470921f dumpfile.h (TDF_FLAGS): New.
* dumpfile.h (TDF_FLAGS): New.
	* dumpfile.c (dump_start): Use TDF_FLAGS.
	(dump_enable_all): Fix TDF_KIND check thinko.

From-SVN: r247908
2017-05-11 14:23:16 +00:00
Kelvin Nilsen 4fd18c782d cmpb-1.c: New test.
gcc/testsuite/ChangeLog:

2017-05-11  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* gcc.target/powerpc/cmpb-1.c: New test.
	* gcc.target/powerpc/cmpb-2.c: New test.
	* gcc.target/powerpc/cmpb-3.c: New test.
	* gcc.target/powerpc/cmpb32-1.c: New test.
	* gcc.target/powerpc/cmpb32-2.c: New test.

gcc/ChangeLog:

2017-05-11  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
	array entries to represent two legal parameterizations of the
	overloaded __builtin_cmpb function, as represented by the
	P6_OV_BUILTIN_CMPB constant.
	(altivec_resolve_overloaded_builtin): Add special case handling
	for the __builtin_cmpb function, as represented by the
	P6_OV_BUILTIN_CMPB constant.
	* config/rs6000/rs6000-builtin.def (BU_P6_2): New macro.
	(BU_P6_64BIT_2): New macro.
	(BU_P6_OVERLOAD_2): New macro
	(CMPB_32): Add 32-bit compare-bytes support for 32-bit only targets.
	(CMPB): Add 64-bit compare-bytes support for 32-bit and 64-bit targets.
	(CMPB): Add overload support to represent both 32-bit and 64-bit
	compare-bytes function.
	* config/rs6000/rs6000.c (rs6000_builtin_mask_calculate): Add
	support for TARGET_CMPB.
	* config/rs6000/rs6000.h: Add support for RS6000_BTM_CMPB.
	* doc/extend.texi (PowerPC AltiVec Built-in Functions): Add
	documentation of the __builtin_cmpb overloaded built-in function.

From-SVN: r247907
2017-05-11 14:13:31 +00:00
Richard Biener 43b883a990 re PR tree-optimization/80705 (Incorrect code generated for profile counter updates due to SLP+LIM)
2017-05-11  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80705
	* tree-vect-data-refs.c (vect_analyze_data_refs): DECL_NONALIASED
	bases are not vectorizable.

	* gcc.dg/vect/bb-slp-pr80705.c: New testcase.

From-SVN: r247906
2017-05-11 14:08:07 +00:00
Jonathan Wakely f8cba3aaae PR libstdc++/80285 optimize std::make_shared for -fno-rtti
PR libstdc++/80285
	* include/bits/shared_ptr_base.h (_Sp_make_shared_tag::_S_ti): Define
	function to get unique fake std::type_info reference.
	(_Sp_counted_ptr_inplace::_M_get_deleter) [!__cpp_rtti]: Compare to
	_S_ti() fake reference.
	(__shared_ptr(_Sp_make_shared_tag, const Alloc&, Args&&...)): Share
	single implementation with or without RTTI enable.
	[!__cpp_rtti]: Pass fake reference to _M_get_deleter.
	* testsuite/20_util/shared_ptr/creation/alloc.cc: Change expected
	allocation and deallocation counts.
	* testsuite/20_util/shared_ptr/creation/single_allocation.cc: New.
	* testsuite/20_util/shared_ptr/creation/single_allocation_no_rtti.cc:
	New.

From-SVN: r247905
2017-05-11 14:21:07 +01:00
Nathan Sidwell 29b871ec5e scanlang.exp: New.
* lib/scanlang.exp: New.
	* lib/gcc-dg.exp: Load scanlang.exp.
	* g++.dg/inherit/covariant7.C: Use scan-lang-dump.

From-SVN: r247904
2017-05-11 13:09:42 +00:00
Mikhail Maltsev c587104e11 GIMPLEFE: Handle invalid SSA names
gcc/testsuite/

	PR testsuite/80580
	* gcc.dg/gimplefe-error-6.c: New test.

gcc/c/

	PR testsuite/80580
	* gimple-parser.c (c_parser_parse_ssa_name): Validate SSA name base.

From-SVN: r247903
2017-05-11 12:27:37 +00:00
Nathan Sidwell 056a17ee6c cp-tree.h (pushdecl, [...]): Move declarations to ...
* cp-tree.h (pushdecl, pushdecl_maybe_friend, pushtag)
	pushtag_top_level_maybe_friend,
	pushdecl_top_level_and_finish):	Move declarations to ...
	* name-lookup.h: ... here.  Group pushdecl variants.
	(pushdecl_top_level_and_finish): Rename to ...
	(pushdecl_top_level_with_init): ... here.
	* decl.c (cp_make_fname_decl): Use pushdecl_top_level_with_init.
	* decl2.c (get_guard, handle_tls_init): Likewise.
	* rtti.c (get_tinfo_decl, tinfo_base_init): Likewise.
	* lambda.c (maybe_add_lambda_conv_op): Use namespace_bindings_p.
	* method.c (implicitly_declare_fn): Likewise.
	* searchc (node_debug_info_needed): Likewise.
	* name-lookup.c (pushdecl_top_level_and_finish): Rename to ...
	(pushdecl_top_level_with_init): ... here.
	(pop_everything): Use namespace_bindings_p.
(--This line, and those below, will be ignored--

M    cp/ChangeLog
M    cp/method.c
M    cp/cp-tree.h
M    cp/decl.c
M    cp/lambda.c
M    cp/rtti.c
M    cp/name-lookup.c
M    cp/decl2.c
M    cp/name-lookup.h
M    cp/search.c

From-SVN: r247902
2017-05-11 11:57:01 +00:00
Nathan Sidwell 9c82d7b68e name-lookup.h (pop_binding): Rename to pop_local_binding.
* name-lookup.h (pop_binding): Rename to pop_local_binding.
	(getdecls): Rename to get_local_decls.
	* name-lookup.c (pop_binding): Rename to ...
	(pop_local_binding): ... here.
	(pop_bindings_and_leave_scope): Adjust.
	(getdecls): Rename to ...
	(get_local_decls): ... here.  Assert local scope.
	* decl.c (poplevel): Assert not namespace.  Adjust and simplify
	logic.
	(store_parm_decls): Adjust get_local_decls call.
	(parser.c (synthesize_implicit_template_parm): Likewise.

From-SVN: r247901
2017-05-11 11:06:26 +00:00
Mikhail Maltsev 67ac9a9db1 GIMPLEFE: handle invalid __MEM
gcc/c/

	PR testsuite/80580
	* gimple-parser.c (c_parser_gimple_postfix_expression): Handle
	incorrect __MEM syntax.

gcc/testsuite/

	PR testsuite/80580
	* gcc.dg/gimplefe-error-5.c: New test.

From-SVN: r247900
2017-05-11 10:55:52 +00:00
Mikhail Maltsev ac4eb40f5c GIMPLEFE: Handle invalid unary "*" operand type
gcc/c/

	PR testsuite/80580
	* gimple-parser.c (c_parser_gimple_unary_expression): Check argument
	type of unary '*'.

gcc/testsuite/

	PR testsuite/80580
	* gcc.dg/gimplefe-error-4.c: New test.

From-SVN: r247899
2017-05-11 10:48:54 +00:00
Bin Cheng ab9e91f9fc tree-ssa-loop-ivopts.c (determine_set_costs): Skip non-interger when counting register pressure.
* tree-ssa-loop-ivopts.c (determine_set_costs): Skip non-interger
	when counting register pressure.

From-SVN: r247898
2017-05-11 09:57:06 +00:00
Bin Cheng e292d60603 tree-ssa-loop-ivopts.c (compare_cost_pair): New.
* tree-ssa-loop-ivopts.c (compare_cost_pair): New.
	(iv_ca_more_deps): Renamed to ...
	(iv_ca_compare_deps): ... this.
	(iv_ca_extend): Extend iv_ca if NEW_CP is cheaper than OLD_CP.

From-SVN: r247897
2017-05-11 09:55:56 +00:00
Bin Cheng e97cac0271 tree-ssa-loop-ivopts.c (find_interesting_uses): Move inv vars dump to ...
* tree-ssa-loop-ivopts.c (find_interesting_uses): Move inv vars dump
	to ...
	(determine_group_iv_costs): ... here.
	(find_inv_vars_cb): Record inv var if it's not recorded before.

From-SVN: r247896
2017-05-11 09:54:30 +00:00
Bin Cheng ac5344e0be tree-ssa-loop-ivopts.c (allow_ip_end_pos_p): Refine comments.
* tree-ssa-loop-ivopts.c (allow_ip_end_pos_p): Refine comments.
	(get_shiftadd_cost): Ditto.

From-SVN: r247895
2017-05-11 09:52:52 +00:00
Bin Cheng 7a89b97a01 tree-ssa-address.c: Include header file.
* tree-ssa-address.c: Include header file.
	(move_hint_to_base): Return TRUE if BASE_HINT is moved to memory
	address.
	(add_to_parts): Refactor.
	(addr_to_parts): New parameter.  Update use of move_hint_to_base.
	(create_mem_ref): Update use of addr_to_parts.  Re-associate addr
	in new order.

From-SVN: r247894
2017-05-11 09:51:41 +00:00
Bin Cheng 80ca1cfad4 re PR tree-optimization/53090 (suboptimal ivopt)
PR tree-optimization/53090
	* tree-ssa-loop-ivopts.c (enum comp_iv_rewrite): New enum value
	COMP_IV_EXPR_2.
	(extract_cond_operands): Detect condition with IV on both sides
	and return COMP_IV_EXPR_2.
	(find_interesting_uses_cond): Add iv_use for both IVs in condition.
	(rewrite_use_compare): Simplify by removing call to function
	extract_cond_operands.

From-SVN: r247893
2017-05-11 09:50:15 +00:00
Bin Cheng b6a2258fda tree-ssa-loop-ivopts.c (enum comp_iv_rewrite): New.
* tree-ssa-loop-ivopts.c (enum comp_iv_rewrite): New.
	(extract_cond_operands): Detect condition comparing against non-
	invariant bound and return appropriate enum value.
	(find_interesting_uses_cond): Update use of extract_cond_operands.
	Handle its return value accordingly.
	(determine_group_iv_cost_cond, rewrite_use_compare): Ditto.

From-SVN: r247892
2017-05-11 09:48:55 +00:00