Commit Graph

163503 Commits

Author SHA1 Message Date
redi d2e378182a Use steady_clock to implement condition_variable::wait_for
The C++ standard says that std::condition_variable::wait_for should be
implemented to be equivalent to:

  return wait_until(lock, chrono::steady_clock::now() + rel_time);

But the existing implementation uses chrono::system_clock. Now that
wait_until has potentially-different behaviour for chrono::steady_clock,
let's at least try to wait using the correct clock.

2018-08-01  Mike Crowe  <mac@mcrowe.com>

	* include/std/condition_variable (wait_for): Use steady_clock.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263225 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 15:39:57 +00:00
redi 79a8b4c1d7 Report early wakeup of condition_variable::wait_until as no_timeout
As currently implemented, condition_variable always ultimately waits
against std::chrono::system_clock. This clock can be changed in arbitrary
ways by the user which may result in us waking up too early or too late
when measured against the caller-supplied clock.

We can't (yet) do much about waking up too late (PR 41861), but
if we wake up too early we must return cv_status::no_timeout to indicate a
spurious wakeup rather than incorrectly returning cv_status::timeout.

2018-08-01  Mike Crowe  <mac@mcrowe.com>

	* include/std/condition_variable (wait_until): Only report timeout
	if we really have timed out when measured against the
	caller-supplied clock.
	* testsuite/30_threads/condition_variable/members/2.cc: Add test
	case to confirm above behaviour.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263224 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 15:39:45 +00:00
rsandifo e9b7408da7 Fix PR number
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263223 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 15:32:25 +00:00
rsandifo f0bbd5fb18 Fix remove_stmt in vectorizable_simd_clone_call (PR 86758)
vectorizable_simd_clone_call was trying to remove a pattern statement
instead of the original statement,  Fixes existing tests
gcc.dg/pr84452.c and gcc.target/i386/pr84309.c on x86.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/86748
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Don't try
	to remove pattern statements.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263222 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 15:29:36 +00:00
rsandifo 2482dbe8be [07/11] Use single basic block array in loop_vec_info
_loop_vec_info::_loop_vec_info used get_loop_array to get the
order of the blocks when creating stmt_vec_infos, but then used
dfs_enumerate_from to get the order of the blocks that the rest
of the vectoriser uses.  We should be able to use that order
for creating stmt_vec_infos too.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Use the
	result of dfs_enumerate_from when constructing stmt_vec_infos,
	instead of additionally calling get_loop_body.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263221 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 15:14:56 +00:00
rsandifo 3c8b7bc7c4 [06/11] Handle VMAT_INVARIANT separately
Invariant loads were handled as a variation on the code for contiguous
loads.  We detected whether they were invariant or not as a byproduct of
creating the vector pointer ivs: vect_create_data_ref_ptr passed back an
inv_p to say whether the pointer was invariant.

But vectorised invariant loads just keep the original scalar load,
so this meant that detecting invariant loads had the side-effect of
creating an unwanted vector pointer iv.  The placement of the code
also meant that we'd create a vector load and then not use the result.
In principle this is wrong code, since there's no guarantee that there's
a vector's worth of accessible data at that address, but we rely on DCE
to get rid of the load before any harm is done.

E.g., for an invariant load in an inner loop (which seems like the more
common use case for this code), we'd create:

   vectp_a.6_52 = &a + 4;

   # vectp_a.5_53 = PHI <vectp_a.5_54(9), vectp_a.6_52(2)>

   # vectp_a.5_55 = PHI <vectp_a.5_53(3), vectp_a.5_56(10)>

   vect_next_a_11.7_57 = MEM[(int *)vectp_a.5_55];
   next_a_11 = a[_1];
   vect_cst__58 = {next_a_11, next_a_11, next_a_11, next_a_11};

   vectp_a.5_56 = vectp_a.5_55 + 4;

   vectp_a.5_54 = vectp_a.5_53 + 0;

whereas all we want is:

   next_a_11 = a[_1];
   vect_cst__58 = {next_a_11, next_a_11, next_a_11, next_a_11};

This patch moves the handling to its own block and makes
vect_create_data_ref_ptr assert (when creating a full iv) that the
address isn't invariant.

The ncopies handling is unfortunate, but a preexisting issue.
Richi's suggestion of using a vector of vector statements would
let us reuse one statement for all copies.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (vect_create_data_ref_ptr): Remove inv_p
	parameter.
	* tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise.
	When creating an iv, assert that the step is not known to be zero.
	(vect_setup_realignment): Update call accordingly.
	* tree-vect-stmts.c (vectorizable_store): Likewise.
	(vectorizable_load): Likewise.  Handle VMAT_INVARIANT separately.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263220 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 15:14:48 +00:00
rsandifo 0b7ea3a9e2 [05/11] Add a vect_stmt_to_vectorize helper function
This patch adds a helper that does the opposite of vect_orig_stmt:
go from the original scalar statement to the statement that should
actually be vectorised.

The use in the last two hunks of vectorizable_reduction are because
reduc_stmt_info (first hunk) and stmt_info (second hunk) are already
pattern statements if appropriate.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (vect_stmt_to_vectorize): New function.
	* tree-vect-loop.c (vect_update_vf_for_slp): Use it.
	(vectorizable_reduction): Likewise.
	* tree-vect-slp.c (vect_analyze_slp_instance): Likewise.
	(vect_detect_hybrid_slp_stmts): Likewise.
	* tree-vect-stmts.c (vect_is_simple_use): Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263219 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 15:14:42 +00:00
aldyh 11822fb29f * tree-vrp (zero_nonzero_bits_from_bounds): Rename to...
(wide_int_set_zero_nonzero_bits): ...this.
	(zero_nonzero_bits_from_vr): Rename to...
	(vrp_set_zero_nonzero_bits): ...this.
	(extract_range_from_multiplicative_op_1): Abstract wide int
	code...
	(wide_int_range_multiplicative_op): ...here.
	(extract_range_from_binary_expr_1): Extract wide int binary
	operations into their own functions.
	(wide_int_range_lshift): New.
	(wide_int_range_can_optimize_bit_op): New.
	(wide_int_range_shift_undefined_p): New.
	(wide_int_range_bit_xor): New.
	(wide_int_range_bit_ior): New.
	(wide_int_range_bit_and): New.
	(wide_int_range_trunc_mod): New.
	(extract_range_into_wide_ints): New.
	(vrp_shift_undefined_p): New.
	(extract_range_from_multiplicative_op): New.
	(vrp_can_optimize_bit_op): New.
	* tree-vrp.h (value_range::dump): New.
	(wide_int_range_multiplicative_op): New.
	(wide_int_range_lshift):New.
	(wide_int_range_shift_undefined_p): New.
	(wide_int_range_bit_xor): New.
	(wide_int_range_bit_ior): New.
	(wide_int_range_bit_and): New.
	(wide_int_range_trunc_mod): New.
	(zero_nonzero_bits_from_bounds): Rename to...
	(wide_int_set_zero_nonzero_bits): ...this.
	(zero_nonzero_bits_from_vr): Rename to...
	(vrp_set_zero_nonzero_bits): ...this.
	(range_easy_mask_min_max): Rename to...
	(wide_int_range_can_optimize_bit_op): this.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263218 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 15:03:01 +00:00
rsandifo 4a59791f7d [04/11] Add a vect_orig_stmt helper function
This patch just adds a helper function for going from a potential
pattern statement to the original scalar statement.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (vect_orig_stmt): New function.
	* tree-vect-data-refs.c (vect_preserves_scalar_order_p): Use it.
	* tree-vect-loop.c (vect_model_reduction_cost): Likewise.
	(vect_create_epilog_for_reduction): Likewise.
	(vectorizable_live_operation): Likewise.
	* tree-vect-slp.c (vect_find_last_scalar_stmt_in_slp): Likewise.
	(vect_detect_hybrid_slp_stmts, vect_schedule_slp): Likewise.
	* tree-vect-stmts.c (vectorizable_call): Likewise.
	(vectorizable_simd_clone_call, vect_remove_stores): Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263217 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 14:59:51 +00:00
rsandifo 9632f098d4 [03/11] Remove vect_transform_stmt grouped_store argument
Nothing now uses the grouped_store value passed back by
vect_transform_stmt, so we might as well remove it.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (vect_transform_stmt): Remove grouped_store
	argument.
	* tree-vect-stmts.c (vect_transform_stmt): Likewise.
	* tree-vect-loop.c (vect_transform_loop_stmt): Update call accordingly.
	(vect_transform_loop): Likewise.
	* tree-vect-slp.c (vect_schedule_slp_instance): Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263216 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 14:59:35 +00:00
rsandifo 02e9bec21f [02/11] Remove vect_schedule_slp return value
Nothing now uses the vect_schedule_slp return value, so it's not worth
propagating the value through vect_schedule_slp_instance.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vectorizer.h (vect_schedule_slp): Return void.
	* tree-vect-slp.c (vect_schedule_slp_instance): Likewise.
	(vect_schedule_slp): Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263215 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 14:59:25 +00:00
rsandifo 0384ddb002 [01/11] Schedule SLP earlier
vect_transform_loop used to call vect_schedule_slp lazily when it
came across the first SLP statement, but it seems easier to do it
before the main loop.

2018-07-30  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-loop.c (vect_transform_loop_stmt): Remove slp_scheduled
	argument.
	(vect_transform_loop): Update calls accordingly.  Schedule SLP
	instances before the main loop, if any exist.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263214 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 14:58:47 +00:00
rsandifo e95d867aa5 Fix over-widening handling of COND_EXPRs (PR 86749)
This PR is a wrong-code bug caused by the over-widening support.
The minimum input precisions for a COND_EXPR are supposed to apply
only to the "then" and "else" values, but here we were applying
them to the operands of a nested COND_EXPR comparison instead.

2018-08-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	PR tree-optimization/86749
	* tree-vect-patterns.c (vect_determine_min_output_precision_1):
	If the lhs is used in a COND_EXPR, check that it is being used
	as the "then" or "else" value.

gcc/testsuite/
	PR tree-optimization/86749
	* gcc.dg/vect/pr86749.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263213 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 14:40:35 +00:00
cesar 30ac4a8261 [PATCH] Remove use of 'struct map' from plugin (nvptx)
libgomp/
	* plugin/plugin-nvptx.c (struct map): Removed.
	(map_init, map_pop): Remove use of struct map. (map_push):
	Likewise and change argument list.
	* testsuite/libgomp.oacc-c-c++-common/mapping-1.c: New


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263212 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 14:09:56 +00:00
redi 42e4d3a7e7 PR libstdc++/60555 std::system_category() should recognise POSIX errno values
PR libstdc++/60555
	* src/c++11/system_error.cc
	(system_error_category::default_error_condition): New override to
	check for POSIX errno values.
	* testsuite/19_diagnostics/error_category/generic_category.cc: New
	* testsuite/19_diagnostics/error_category/system_category.cc: New
	test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263210 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 13:57:05 +00:00
vries 40632ac35e [nvptx] Define TARGET_HAVE_SPECULATION_SAFE_VALUE
2018-08-01  Tom de Vries  <tdevries@suse.de>

	PR target/86800
	* config/nvptx/nvptx.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define to
	speculation_safe_value_not_needed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263209 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 13:20:32 +00:00
vries 29d354b329 [libgomp, nvptx] Add cuda-lib.def
2018-08-01  Tom de Vries  <tdevries@suse.de>

	* plugin/cuda-lib.def: New file.  Factor out of ...
	* plugin/plugin-nvptx.c (CUDA_CALLS): ... here.
	(struct cuda_lib_s, init_cuda_lib): Include cuda-lib.def instead of
	using CUDA_CALLS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263208 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 13:20:22 +00:00
paolo ea47b34525 /cp
2018-08-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/86661
	* class.c (note_name_declared_in_class): Use location_of in permerror
	instead of DECL_SOURCE_LOCATION (for OVERLOADs).

/testsuite
2018-08-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/86661
	* g++.dg/lookup/name-clash12.C: New.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263207 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 12:09:33 +00:00
rguenth 6985990906 2018-08-01 Richard Biener <rguenther@suse.de>
* tree-ssa-sccvn.c (visit_phi): Compare invariant addresses
	as base and offset.

	* gcc.dg/tree-ssa/ssa-fre-68.c: New testcase.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263206 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 12:03:29 +00:00
uros f144c98a5f * gcc.dg/plugin/poly-int-07_plugin.c (dg-options): Use -O0.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263205 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 11:55:31 +00:00
uros 187617b450 * gcc.dg/tree-ssa/pr84512.c: Xfail on alpha*-*-*.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263204 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 11:13:53 +00:00
marxin a155acdf01 Improve dumping of value profiling transformations.
2018-08-01  Martin Liska  <mliska@suse.cz>

	* value-prof.c (gimple_divmod_fixed_value_transform): Unify
        format how successful transformation is dumped.
	(gimple_mod_pow2_value_transform): Likewise.
	(gimple_mod_subtract_transform): Likewise.
	(gimple_stringops_transform): Likewise.
2018-08-01  Martin Liska  <mliska@suse.cz>

	* gcc.dg/tree-prof/stringop-1.c: Adjust scanned pattern.
	* gcc.dg/tree-prof/stringop-2.c: Likewise.
	* gcc.dg/tree-prof/val-prof-1.c: Likewise.
	* gcc.dg/tree-prof/val-prof-2.c: Likewise.
	* gcc.dg/tree-prof/val-prof-3.c: Likewise.
	* gcc.dg/tree-prof/val-prof-4.c: Likewise.
	* gcc.dg/tree-prof/val-prof-5.c: Likewise.
	* gcc.dg/tree-prof/val-prof-7.c: Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263203 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 10:50:48 +00:00
marxin 874612dc79 __gcov_indirect_call_callee can't be null in __gcov_indirect_call_profiler_v2.
2018-08-01  Martin Liska  <mliska@suse.cz>

	* libgcov-profiler.c (__gcov_indirect_call_profiler_v2): Do not
        check that  __gcov_indirect_call_callee is non-null.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263202 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 10:22:18 +00:00
marxin e1fe418516 Add memmove to value profiling.
2018-08-01  Martin Liska  <mliska@suse.cz>

        PR value-prof/35543
	* value-prof.c (interesting_stringop_to_profile_p):
        Simplify the code and add BUILT_IN_MEMMOVE.
	(gimple_stringops_transform): Likewise.
2018-08-01  Martin Liska  <mliska@suse.cz>

        PR value-prof/35543
	* gcc.dg/tree-prof/val-prof-7.c: Add __builtin_memmove.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263201 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 10:21:49 +00:00
sudi 54d19dc9b5 [PATCH][AArch64] Stop redundant zero-extension after UMOV when in DI mode
This patch extends the aarch64_get_lane_zero_extendsi instruction
definition to also cover DI mode. This prevents a redundant AND
instruction from being generated due to the pattern failing to be matched.

Committed on behalf of Sam Tebbs.

gcc/
2018-08-01  Sam Tebbs  <sam.tebbs@arm.com>

	* config/aarch64/aarch64-simd.md
	(*aarch64_get_lane_zero_extendsi<mode>): Rename to...
	(*aarch64_get_lane_zero_extend<GPI:mode><VDQQH:mode>): ... This and
	use GPI iterator instead of SI mode.

gcc/testsuite
2018-08-01  Sam Tebbs  <sam.tebbs@arm.com>

	* gcc.target/aarch64/extract_zero_extend.c: New file.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263200 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 10:10:28 +00:00
jakub c1e4a7a554 PR c/85704
* c-typeck.c (init_field_decl_cmp): New function.
	(output_pending_init_elements): Use it for field comparisons
	instead of pure bit_position comparisons.

	* gcc.c-torture/compile/pr85704.c: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263198 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 09:10:31 +00:00
rearnsha 451ed1ab9c rs6000 - add speculation_barrier pattern
This patch reworks the existing rs6000_speculation_barrier pattern to
work with the new __builtin_sepculation_safe_value() intrinsic.  The
change is trivial as it simply requires renaming the existing speculation
barrier pattern.

So the total patch is to delete 14 characters!

	* config/rs6000/rs6000.md (speculation_barrier): Renamed from
	rs6000_speculation_barrier.
	* config/rs6000/rs6000.c (rs6000_expand_builtin): Adjust for
	new barrier pattern name.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263197 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 08:16:48 +00:00
rearnsha 5812770a02 x86 - add speculation_barrier pattern
This patch adds a speculation barrier for x86, based on my
understanding of the required mitigation for that CPU, which is to use
an lfence instruction.

This patch needs some review by an x86 expert and if adjustments are
needed, I'd appreciate it if they could be picked up by the port
maintainer.  This is supposed to serve as an example of how to deploy
the new __builtin_speculation_safe_value() intrinsic on this
architecture.

	* config/i386/i386.md (unspecv): Add UNSPECV_SPECULATION_BARRIER.
	(speculation_barrier): New insn.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263196 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 08:16:38 +00:00
rguenth d647085444 2018-08-01 Richard Biener <rguenther@suse.de>
PR bootstrap/86724
	* graphite.h: Include isl/id.h and isl/space.h to allow build
	with ISL 0.20.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263193 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 07:21:08 +00:00
rguenth 66303da22f 2018-08-01 Jan Willem Jagersma <jwjagersma@gmail.com>
PR target/86651
	* dwarf2out.c (dwarf2out_early_finish): Do not generate assembly in LTO
	mode for COFF targets.
	* defaults.h (TARGET_COFF): Define.
	* config/i386/djgpp.h (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END,
	TARGET_COFF): Define.
	(i386_djgpp_asm_lto_start, i386_djgpp_asm_lto_end): Declare.
	* config/i386/djgpp.c (saved_debug_info_level): New static variable.
	(i386_djgpp_asm_lto_start, i386_djgpp_asm_lto_end): New functions.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263191 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 06:52:44 +00:00
gccadmin 71002f41a9 Daily bump.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263190 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 00:16:20 +00:00
ian 067172f1ec runtime: use poll rather than pollset for netpoll on AIX
Updates golang/go#26634
    
    Reviewed-on: https://go-review.googlesource.com/126857


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263186 138bc75d-0d04-0410-961f-82ee72b054a4
2018-08-01 00:05:05 +00:00
redi 785c6c31ab PR libstdc++/86751 default assignment operators for std::pair
The solution for PR 77537 causes ambiguities due to the extra copy
assignment operator taking a __nonesuch_no_braces parameter. By making
the base class non-assignable we don't need the extra deleted overload
in std::pair. The copy assignment operator will be implicitly deleted
(and the move assignment operator not declared) as needed. Without the
additional user-provided operator in std::pair the ambiguity is avoided.

	PR libstdc++/86751
	* include/bits/stl_pair.h (__pair_base): New class with deleted copy
	assignment operator.
	(pair): Derive from __pair_base.
	(pair::operator=): Remove deleted overload.
	* python/libstdcxx/v6/printers.py (StdPairPrinter): New pretty printer
	so that new base class isn't shown in GDB.
	* testsuite/20_util/pair/86751.cc: New test.
	* testsuite/20_util/pair/ref_assign.cc: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263185 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 22:31:20 +00:00
redi 3ee8fe55e0 Don't unconditionally define feature test macros in <version>
The macro definitions in <version> should depend on the same
preprocessor conditions as the original macros in other headers.
Otherwise <version> can define macros that imply the availability of
features that are not actually defined.

This fix is incomplete, as __cpp_lib_filesystem should depend on whether
libstdc++fs.a is supported, and several macros should only be defined
when _GLIBCXX_HOSTED is defined. Also, the feature test macros should
define their value as type long, but most are type int.

	* include/bits/c++config (_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP)
	(_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE): Move definitions here.
	(_GLIBCXX_HAVE_BUILTIN_LAUNDER): Likewise. Use !__is_identifier
	instead of __has_builtin.
	* include/std/type_traits (_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP)
	(_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE): Remove definitions from here.
	* include/std/version [!_GLIBCXX_HAS_GTHREADS]
	(__cpp_lib_shared_timed_mutex, __cpp_lib_scoped_lock)
	(__cpp_lib_shared_mutex): Don't define when Gthreads not in use.
	[!_GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP]
	(__cpp_lib_has_unique_object_representations): Don't define when
	builtin not available.
	[!_GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE] (__cpp_lib_is_aggregate):
	Likewise.
	[!_GLIBCXX_HAVE_BUILTIN_LAUNDER] (__cpp_lib_launder): Likewise.
	* libsupc++/new (_GLIBCXX_HAVE_BUILTIN_LAUNDER): Remove definition
	from here.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263184 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 22:31:14 +00:00
aoliva f89ca6e1a6 Save discriminator info for LTO
for  gcc/ChangeLog

	* gimple-streamer-in.c (input_bb): Restore BB discriminator.
	* gimple-streamer-out.c (output_bb): Save it.
	* lto-streamer-in.c (input_struct_function_base): Restore
	instance discriminator if available.  Create map on demand.
	* lto-streamer-out.c (output_struct_function_base): Save it if
	available.
	* final.c (decl_to_instance_map): Document LTO strategy.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263183 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 21:19:25 +00:00
aoliva 0b2927f031 Introduce instance discriminators
With -gnateS, the Ada compiler sets itself up to output discriminators
for different instantiations of generics, but the middle and back ends
have lacked support for that.  This patch introduces the missing bits,
translating the GNAT-internal representation of the per-file instance
map to an instance_table that maps decls to instance discriminators.


From: Alexandre Oliva  <oliva@adacore.com>, Olivier Hainque  <hainque@adacore.com>
for  gcc/ChangeLog

	* debug.h (decl_to_instance_map_t): New type.
	(decl_to_instance_map): Declare.
	(maybe_create_decl_to_instance_map): New inline function.
    	* final.c (bb_discriminator, last_bb_discriminator): New statics,
    	to track basic block discriminators.
    	(final_start_function_1): Initialize them.
    	(final_scan_insn_1): On NOTE_INSN_BASIC_BLOCK, track
	bb_discriminator.
	(decl_to_instance_map): New variable.
	(map_decl_to_instance, maybe_set_discriminator): New functions.
    	(notice_source_line): Set discriminator.

for  gcc/ada/ChangeLog

	* trans.c: Include debug.h.
	(file_map): New static variable.
	(gigi): Set it.  Create decl_to_instance_map when needed.
	(Subprogram_Body_to_gnu): Pass gnu_subprog_decl to...
	(Sloc_to_locus): ... this.  Add decl parm, map it to instance.
	* gigi.h (Sloc_to_locus): Adjust declaration.

for  gcc/testsuite/ChangeLog

	* gnat.dg/dinst.adb: New.
	* gnat.dg/dinst_pkg.ads, gnat.dg/dinst_pkg.adb: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263182 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 21:19:13 +00:00
dmalcolm 98605dea9f c-family: clean up the data tables in c-format.c
The format_char_info tables in c-format.c for our own formats contain
a lot of repetition.

This patch adds a macro to express the conversion specifiers implemented
within pp_format, making it clearer which are custom ones added by the
various diagnostic_format_decoder callbacks.

Doing so uncovered a few mistakes in the data (based on comparison with
the source of the diagnostic_format_decoder callbacks, and the notes
below), which the patch fixes:

- gcc_diag_char_table didn't have 'Z', but it *is* implemented by pp_format.

- removed erroneous 'G' and 'K' entries from gcc_diag_char_table: they're
  implemented by default_tree_printer (and thus in "tdiag") and by the
  C/C++ FEs, but not in pp_format.

- removed "v" (lower case) from gcc_tdiag_char_table and
  gcc_cxxdiag_char_table

Notes:

pretty-print.h uses this for ATTRIBUTE_GCC_PPDIAG, used by pp_printf
and pp_verbatim:

whereas diagnostic-core.h uses this for ATTRIBUTE_GCC_DIAG, used by
the various diagnostic functions:

/* If we haven't already defined a front-end-specific diagnostics
   style, use the generic one.  */

Hence I'm assuming that __gcc_diag__ is for use for when we don't
know what kind of diagnostic_format_decoder we have, and we can
only rely on pp_format's core functionality, where __gcc_tdiag__
is allowed to assume default_tree_printer.

gcc/c-family/ChangeLog:
	* c-format.c (PP_FORMAT_CHAR_TABLE): New macro, based on existing
	table entries for gcc_diag_char_table, and the 'Z' entry from
	gcc_tdiag_char_table, changing the "chain" entry for 'Z' from
	&gcc_tdiag_char_table[0] to &gcc_diag_char_table[0].
	(gcc_diag_char_table): Use PP_FORMAT_CHAR_TABLE, implicitly
	adding missing "Z" for this table.  Remove erroneous "G" and "K"
	entries.
	(gcc_tdiag_char_table): Use PP_FORMAT_CHAR_TABLE.  Remove "v".
	(gcc_cdiag_char_table): Use PP_FORMAT_CHAR_TABLE.
	(gcc_cxxdiag_char_table): Use PP_FORMAT_CHAR_TABLE.  Remove "v".

gcc/testsuite/ChangeLog:
	* gcc.dg/format/gcc_diag-1.c (foo): Update the %v tests for
	tdiag and cxxdiag.
	* gcc.dg/format/gcc_diag-10.c (test_diag): Update tests of %G
	and %K.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263181 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 21:08:55 +00:00
ian 30929ff699 * targhooks.c (default_have_speculation_safe_value): Add
ATTRIBUTE_UNUSED.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263180 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 20:51:06 +00:00
dmalcolm 71e711b71a dumpfile.c: eliminate special-casing of dump_file/alt_dump_file
With the addition of optinfo, the various dump_* calls had three parts:
- optionally print to dump_file
- optionally print to alt_dump_file
- optionally make an optinfo_item and add it to the pending optinfo,
  creating it for dump_*_loc calls.

However, this split makes it difficult to implement the formatted dumps
later in patch kit, so as enabling work towards that, this patch removes
the above split, so that all dumping within the dump_* API goes through
optinfo_item.

In order to ensure that the dumps to dump_file and alt_dump_file are
processed immediately (rather than being buffered within the pending
optinfo for consolidation), this patch introduces the idea of "immediate"
optinfo_item destinations vs "non-immediate" destinations.

The patch also adds selftest coverage of what's printed, and of scopes.

This adds two allocations per dump_* call when dumping is enabled.
I'm assuming that this isn't a problem, as dump_enabled_p is normally
false.  There are ways of optimizing it if it is an issue (by making
optinfo_item instances become temporaries that borrow the underlying
buffer), but they require nontrivial changes, so I'd prefer to leave
that for another patch kit, if it becomes necessary.

gcc/ChangeLog:
	* dump-context.h: Include "pretty-print.h".
	(dump_context::refresh_dumps_are_enabled): New decl.
	(dump_context::emit_item): New decl.
	(class dump_context): Add fields "m_test_pp" and
	"m_test_pp_flags".
	(temp_dump_context::temp_dump_context): Add param "test_pp_flags".
	(temp_dump_context::get_dumped_text): New decl.
	(class temp_dump_context): Add field "m_pp".
	* dumpfile.c (refresh_dumps_are_enabled): Convert to...
	(dump_context::refresh_dumps_are_enabled): ...and add a test for
	m_test_pp.
	(set_dump_file): Update for above change.
	(set_alt_dump_file): Likewise.
	(dump_loc): New overload, taking a pretty_printer *.
	(dump_context::dump_loc): Call end_any_optinfo.  Dump the location
	to any test pretty-printer.
	(make_item_for_dump_gimple_stmt): New function, adapted from
	optinfo::add_gimple_stmt.
	(dump_context::dump_gimple_stmt): Call it, and use the result,
	eliminating the direct usage of dump_file and alt_dump_file in
	favor of indirectly using them via emit_item.
	(make_item_for_dump_gimple_expr): New function, adapted from
	optinfo::add_gimple_expr.
	(dump_context::dump_gimple_expr): Call it, and use the result,
	eliminating the direct usage of dump_file and alt_dump_file in
	favor of indirectly using them via emit_item.
	(make_item_for_dump_generic_expr): New function, adapted from
	optinfo::add_tree.
	(dump_context::dump_generic_expr): Call it, and use the result,
	eliminating the direct usage of dump_file and alt_dump_file in
	favor of indirectly using them via emit_item.
	(make_item_for_dump_printf_va): New function, adapted from
	optinfo::add_printf_va.
	(make_item_for_dump_printf): New function.
	(dump_context::dump_printf_va): Call make_item_for_dump_printf_va,
	and use the result, eliminating the direct usage of dump_file and
	alt_dump_file in favor of indirectly using them via emit_item.
	(make_item_for_dump_dec): New function.
	(dump_context::dump_dec): Call it, and use the result,
	eliminating the direct usage of dump_file and alt_dump_file in
	favor of indirectly using them via emit_item.
	(make_item_for_dump_symtab_node): New function, adapted from
	optinfo::add_symtab_node.
	(dump_context::dump_symtab_node): Call it, and use the result,
	eliminating the direct usage of dump_file and alt_dump_file in
	favor of indirectly using them via emit_item.
	(dump_context::begin_scope): Reimplement, avoiding direct usage
	of dump_file and alt_dump_file in favor of indirectly using them
	via emit_item.
	(dump_context::emit_item): New member function.
	(temp_dump_context::temp_dump_context): Add param "test_pp_flags".
	Set up test pretty-printer on the underlying context.  Call
	refresh_dumps_are_enabled.
	(temp_dump_context::~temp_dump_context): Call
	refresh_dumps_are_enabled.
	(temp_dump_context::get_dumped_text): New member function.
	(selftest::verify_dumped_text): New function.
	(ASSERT_DUMPED_TEXT_EQ): New macro.
	(selftest::test_capture_of_dump_calls): Run all tests twice, with
	and then without optinfo enabled.  Add uses of
	ASSERT_DUMPED_TEXT_EQ to all tests.  Add test of nested scopes.
	* dumpfile.h: Update comment for the dump_* API.
	* optinfo-emit-json.cc
	(selftest::test_building_json_from_dump_calls): Update for new
	param for temp_dump_context ctor.
	* optinfo.cc (optinfo_item::optinfo_item): Remove "owned" param
	and "m_owned" field.
	(optinfo_item::~optinfo_item): Likewise.
	(optinfo::add_item): New member function.
	(optinfo::emit): Update comment.
	(optinfo::add_string): Delete.
	(optinfo::add_printf): Delete.
	(optinfo::add_printf_va): Delete.
	(optinfo::add_gimple_stmt): Delete.
	(optinfo::add_gimple_expr): Delete.
	(optinfo::add_tree): Delete.
	(optinfo::add_symtab_node): Delete.
	(optinfo::add_dec): Delete.
	* optinfo.h (class dump_context): New forward decl.
	(optinfo::add_item): New decl.
	(optinfo::add_string): Delete.
	(optinfo::add_printf): Delete.
	(optinfo::add_printf_va): Delete.
	(optinfo::add_gimple_stmt): Delete.
	(optinfo::add_gimple_expr): Delete.
	(optinfo::add_tree): Delete.
	(optinfo::add_symtab_node): Delete.
	(optinfo::add_dec): Delete.
	(optinfo::add_poly_int): Delete.
	(optinfo_item::optinfo_item): Remove "owned" param.
	(class optinfo_item): Remove field "m_owned".



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263178 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 19:22:48 +00:00
jozefl 2fa87500c8 PR middle-end/86705
* gcc/cfgexpand.c (set_parm_rtl): Use the alignment of Pmode when
	MAX_SUPPORTED_STACK_ALIGNMENT would otherwise be exceeded by the
	requested variable alignment.
	(expand_one_ssa_partition): Likewise.
	(expand_one_var): Likewise.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263177 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 18:17:00 +00:00
rearnsha 15b442ae8f pdp11 - example of a port not needing a speculation barrier
This patch is intended as an example of all that is needed if the
target system doesn't support CPUs that have speculative execution.
I've chosen the pdp11 port on the basis that it's old enough that this
is likely to be true for all existing implementations and that there
is also little chance of that changing in future!

	* config/pdp11/pdp11.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Redefine
	to speculation_safe_value_not_needed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263176 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:36:45 +00:00
rearnsha 3e3448a9ae targhooks - provide an alternative hook for targets that never execute speculatively
This hook adds an alternative implementation for the target hook
TARGET_HAVE_SPECULATION_SAFE_VALUE; it can be used by targets that have no
CPU implementations that execute code speculatively.  All that is needed for
such targets now is to add:

 #undef TARGET_HAVE_SPECULATION_SAFE_VALUE
 #define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed.

to where you have your other target hooks and you're done.

gcc:
	* targhooks.h (speculation_safe_value_not_needed): New prototype.
	* targhooks.c (speculation_safe_value_not_needed): New function.
	* target.def (have_speculation_safe_value): Update documentation.
	* doc/tm.texi: Regenerated.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263175 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:36:36 +00:00
rearnsha ce52014ace AArch64 - use CSDB based sequences if speculation tracking is enabled
In this final patch, now that we can track speculation through conditional
branches, we can use this information to use a less expensive CSDB based
speculation barrier.

	* config/aarch64/iterators.md (ALLI_TI): New iterator.
	* config/aarch64/aarch64.md (despeculate_copy<ALLI_TI:mode>): New
	expand.
	(despeculate_copy<ALLI:mode>_insn): New insn.
	(despeculate_copyti_insn): New insn.
	(despeculate_simple<ALLI:mode>): New insn
	(despeculate_simpleti): New insn.
	* config/aarch64/aarch64.c (aarch64_speculation_safe_value): New
	function.
	(TARGET_SPECULATION_SAFE_VALUE): Redefine to
	aarch64_speculation_safe_value.
	(aarch64_print_operand): Handle const0_rtx in modifier 'H'.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263174 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:36:26 +00:00
rearnsha b19562a816 AArch64 - new pass to add conditional-branch speculation tracking
This patch is the main part of the speculation tracking code.  It adds
a new target-specific pass that is run just before the final branch
reorg pass (so that it can clean up any new edge insertions we make).
The pass is only run with -mtrack-speculation is passed on the command
line.

One thing that did come to light as part of this was that the stack pointer
register was not being permitted in comparision instructions.  We rely on
that for moving the tracking state between SP and the scratch register at
function call boundaries.

	* config/aarch64/aarch64-speculation.cc: New file.
	* config/aarch64/aarch64-passes.def (pass_track_speculation): Add before
	pass_reorder_blocks.
	* config/aarch64/aarch64-protos.h (make_pass_track_speculation): Add
	prototype.
	* config/aarch64/aarch64.c (aarch64_conditional_register_usage): Fix
	X14 and X15 when tracking speculation.
	* config/aarch64/aarch64.md (register name constants): Add
	SPECULATION_TRACKER_REGNUM and SPECULATION_SCRATCH_REGNUM.
	(unspec): Add UNSPEC_SPECULATION_TRACKER.
	(speculation_barrier): New insn attribute.
	(cmp<mode>): Allow SP in comparisons.
	(speculation_tracker): New insn.
	(speculation_barrier): Add speculation_barrier attribute.
	* config/aarch64/t-aarch64: Add make rule for aarch64-speculation.o.
	* config.gcc (aarch64*-*-*): Add aarch64-speculation.o to extra_objs.
	* doc/invoke.texi (AArch64 Options): Document -mtrack-speculation.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263173 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:36:18 +00:00
rearnsha eaf891585b AArch64 - disable CB[N]Z TB[N]Z when tracking speculation
The CB[N]Z and TB[N]Z instructions do not expose the comparison through
the condition code flags.  This makes it impossible to track speculative
execution through such a branch.  We can handle this relatively easily
by simply disabling the patterns in this case.

A side effect of this is that the split patterns for the atomic operations
need to also avoid generating these instructions.  They mostly have simple
fall-backs for this already.

	* config/aarch64/aarch64.md (cb<optab><mode>1): Disable when
	aarch64_track_speculation is true.
	(tb<optab><mode>1): Likewise.
	* config/aarch64/aarch64.c (aarch64_split_compare_regs): Do not
	generate CB[N]Z when tracking speculation.
	(aarch64_split_compare_and_swap): Likewise.
	(aarch64_split_atomic_op): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263172 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:36:09 +00:00
rearnsha 97eb2b8649 AArch64 - Add new option -mtrack-speculation
This patch doesn't do anything useful, it simply adds a new command-line
option -mtrack-speculation to AArch64.  Subsequent patches build on this.

	* config/aarch64/aarch64.opt (mtrack-speculation): New target option.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263171 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:36:00 +00:00
rearnsha f9d2906f0b AArch64 - add speculation barrier
Similar to Arm, this adds an unconditional speculation barrier for AArch64.

	* config/aarch64.md (unspecv): Add UNSPECV_SPECULAION_BARRIER.
	(speculation_barrier): New insn.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263170 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:35:50 +00:00
rearnsha be626997e0 Arm - add speculation_barrier pattern
This patch defines a speculation barrier for AArch32.

	* config/arm/unspecs.md (unspecv): Add VUNSPEC_SPECULATION_BARRIER.
	* config/arm/arm.md (speculation_barrier): New expand.
	(speculation_barrier_insn): New pattern.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263169 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:35:41 +00:00
rearnsha 123081efd4 Add __builtin_speculation_safe_value
This patch defines a new intrinsic function
__builtin_speculation_safe_value.  A generic default implementation is
defined which will attempt to use the backend pattern
"speculation_safe_barrier".  If this pattern is not defined, or if it
is not available, then the compiler will emit a warning, but
compilation will continue.

Note that the test spec-barrier-1.c will currently fail on all
targets.  This is deliberate, the failure will go away when
appropriate action is taken for each target backend.

gcc:
	* builtin-types.def (BT_FN_PTR_PTR_VAR): New function type.
	(BT_FN_I1_I1_VAR, BT_FN_I2_I2_VAR, BT_FN_I4_I4_VAR): Likewise.
	(BT_FN_I8_I8_VAR, BT_FN_I16_I16_VAR): Likewise.
	* builtin-attrs.def (ATTR_NOVOPS_NOTHROW_LEAF_LIST): New attribute
	list.
	* builtins.def (BUILT_IN_SPECULATION_SAFE_VALUE_N): New builtin.
	(BUILT_IN_SPECULATION_SAFE_VALUE_PTR): New internal builtin.
	(BUILT_IN_SPECULATION_SAFE_VALUE_1): Likewise.
	(BUILT_IN_SPECULATION_SAFE_VALUE_2): Likewise.
	(BUILT_IN_SPECULATION_SAFE_VALUE_4): Likewise.
	(BUILT_IN_SPECULATION_SAFE_VALUE_8): Likewise.
	(BUILT_IN_SPECULATION_SAFE_VALUE_16): Likewise.
	* builtins.c (expand_speculation_safe_value): New function.
	(expand_builtin): Call it.
	* doc/cpp.texi: Document predefine __HAVE_SPECULATION_SAFE_VALUE.
	* doc/extend.texi: Document __builtin_speculation_safe_value.
	* doc/md.texi: Document "speculation_barrier" pattern.
	* doc/tm.texi.in: Pull in TARGET_SPECULATION_SAFE_VALUE and
	TARGET_HAVE_SPECULATION_SAFE_VALUE.
	* doc/tm.texi: Regenerated.
	* target.def (have_speculation_safe_value, speculation_safe_value): New
	hooks.
	* targhooks.c (default_have_speculation_safe_value): New function.
	(default_speculation_safe_value): New function.
	* targhooks.h (default_have_speculation_safe_value): Add prototype.
	(default_speculation_safe_value): Add prototype.

c-family:
	* c-common.c (speculation_safe_resolve_call): New function.
	(speculation_safe_resolve_params): New function.
	(speculation_safe_resolve_return): New function.
	(resolve_overloaded_builtin): Handle __builtin_speculation_safe_value.
	* c-cppbuiltin.c (c_cpp_builtins): Add pre-define for
	__HAVE_SPECULATION_SAFE_VALUE.

testsuite:
	* c-c++-common/spec-barrier-1.c: New test.
	* c-c++-common/spec-barrier-2.c: New test.
	* gcc.dg/spec-barrier-3.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263168 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 17:35:32 +00:00
dmalcolm 291c13cb1a Simplify dump_context by adding a dump_loc member function
This patch removes some duplicated code in dumpfile.c by
reimplementing the various dump_foo_loc calls in terms of dump_foo.

gcc/ChangeLog:
	* dump-context.h (dump_context::dump_loc): New decl.
	* dumpfile.c (dump_context::dump_loc): New member function.
	(dump_context::dump_gimple_stmt_loc): Reimplement using dump_loc
	and dump_gimple_stmt.
	(dump_context::dump_gimple_expr_loc): Likewise, using
	dump_gimple_expr.
	(dump_context::dump_generic_expr_loc): Likewise, using
	dump_generic_expr.
	(dump_context::dump_printf_loc_va): Likewise, using
	dump_printf_va.
	(dump_context::begin_scope): Explicitly using the global function
	"dump_loc", rather than the member function.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263167 138bc75d-0d04-0410-961f-82ee72b054a4
2018-07-31 16:51:17 +00:00