Commit Graph

165277 Commits

Author SHA1 Message Date
Jakub Jelinek 6a3ebcc662 re PR c++/88110 (ICE (segfault) with -std=C++2a in cxx_eval_constant_expression when trying to evaluate nonoverridden "virtual ... = 0" function of a base class)
PR c++/88110
	* constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Punt
	if get_base_address of ADDR_EXPR operand is not a DECL_P.

	* g++.dg/cpp2a/constexpr-virtual13.C: New test.

From-SVN: r266329
2018-11-20 23:23:12 +01:00
Jakub Jelinek 260a993319 re PR tree-optimization/87895 (ICE in purge_dead_edges, at cfgrtl.c:3246)
PR tree-optimization/87895
	* omp-simd-clone.c (ipa_simd_modify_function_body): When removing
	or replacing GIMPLE_RETURN, set EDGE_FALLTHRU on the edge to EXIT.
	(simd_clone_adjust): Don't set EDGE_FALLTHRU here. In a loop that
	redirects edges to EXIT to edges to incr_bb, iterate while EXIT
	has any preds and always use EDGE_PRED (, 0).

	* gcc.dg/gomp/pr87895-1.c: New test.
	* gcc.dg/gomp/pr87895-2.c: New test.
	* gcc.dg/gomp/pr87895-3.c: New test.

From-SVN: r266328
2018-11-20 21:44:38 +01:00
Uros Bizjak 59730cc567 re PR target/88070 (ICE in create_pre_exit, at mode-switching.c:438)
PR target/88070
	* mode-switching.c (create_pre_exit): After reload, always split the
	fallthrough edge to the exit block.

testsuite/ChangeLog:

	PR target/88070
	* gcc.target/i386/pr88070.c: New test.

From-SVN: r266326
2018-11-20 20:43:20 +01:00
Jan Hubicka 012b51cf21 ipa-devirt.c (add_type_duplicate): Do not ICE on incomplete enums.
* ipa-devirt.c (add_type_duplicate): Do not ICE on incomplete enums.
	* tree.c (build_array_type_1): Forward declare.
	(fld_type_variant_equal_p): Add INNER_TYPE parameter.
	(fld_type_variant): Likewise.
	(fld_simplified_types): New hash.
	(fld_process_array_type): New function.
	(fld_incomplete_type_of): Handle array and enumeration types.
	(fld_simplified_type): Handle simplification of arrays.
	(free_lang_data): Allocate and free simplified types hash.

From-SVN: r266325
2018-11-20 18:06:03 +00:00
Jan Hubicka 5702bb9494 Fix missing commit log.
From-SVN: r266323
2018-11-20 17:00:46 +00:00
Jan Hubicka 7656fa3e63 re PR ipa/87957 (ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519)
PR lto/87957
	* ipa-devirt.c (odr_subtypes_equivalent_p): Report ODR violation
	when sybtype already violates ODR.
	(get_odr_type): Do not ICE when insert is false and type duplicate
	is not registered yet.
	(register_odr_type): Be sure to register subtypes first.

From-SVN: r266322
2018-11-20 16:22:19 +00:00
Andreas Krebbel 33f3393ab5 S/390: Fix flogr RTX.
The flogr instruction uses a 64 bit register pair target operand.  In
the RTX we model this as a write to a TImode register.  Unfortunately
the RTX's being assigned to the two parts of the target operand were
swapped.  This is no problem if in the end the flogr instruction will
be emitted since the instruction still does what the clzdi expander
expects.  However, a problem arises when the RTX is used to optimize
CLZ for a constant input operand.  Even then it matters only if the
expression couldn't be folded on tree level already.

In the testcase this happened thanks to loop unrolling on RTL level.
The iteration variable is used as an argument to the clz
builtin. Due to the loop unrolling it becomes a constant and after
folding the broken RTX leads to a wrong assumption.

gcc/ChangeLog:

2018-11-20  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390.md ("clztidi2"): Swap the RTX's written to the
	DImode parts of the target operand.

gcc/testsuite/ChangeLog:

2018-11-20  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/flogr-1.c: New test.

From-SVN: r266321
2018-11-20 16:19:54 +00:00
Jan Hubicka 84bfc73289 re PR ipa/87706 (Inlined functions trigger invalid -Wmissing-profile warning)
PR ipa/87706
	* ipa-fnsummary.c (pass_ipa_fnsummary): Do not remove functions
	* ipa.c (possible_inline_candidate_p): Break out from ..
	(process_references): ... here ; drop before_inlining_p;
	cleanup handling of alises.
	(walk_polymorphic_call_targets): Likewise.
	(symbol_table::remove_unreachable_nodes): Likewise.
	* passes.c (pass_data_ipa_remove_symbols): New structure.
	(pass_ipa_remove_symbols): New pass.
	(make_pass_ipa_remove_symbols): New function.
	* tree-pass.h (make_pass_ipa_remove_symbols): Declare.
	* passes.def (pass_ipa_remove_symbols): Schedule after early passes.

From-SVN: r266320
2018-11-20 15:58:37 +00:00
Nathan Sidwell 0b68083209 re PR tree-optimization/87926 (bad array-index warning breaks --disable-checking bootstrap)
PR 87926
	* Makefile.in (bitmap.o-warn): Use -Wno-error=array-bounds.

From-SVN: r266319
2018-11-20 15:54:12 +00:00
Jan Hubicka 375c3b863c re PR lto/87997 (ICE in cp_var_mod_type_p at gcc/cp/cp-objcp-common.c:107 since r265870)
PR lto/87997
	* tree.c (free_lang_data_in_cgraph): Add argument fld; break out
	type checking to...
	(free_lang_data) ... here; update call of free_lang_data_in_cgraph.

From-SVN: r266316
2018-11-20 14:09:27 +00:00
Jan Hubicka 12485662c0 re PR ipa/87706 (Inlined functions trigger invalid -Wmissing-profile warning)
PR ipa/87706
	* ipa-fnsummary.c (pass_ipa_fnsummary): Do not remove functions
	* ipa.c (possible_inline_candidate_p): Break out from ..
	(process_references): ... here ; drop before_inlining_p;
	cleanup handling of alises.
	(walk_polymorphic_call_targets): Likewise.
	(symbol_table::remove_unreachable_nodes): Likewise.
	* passes.c (pass_data_ipa_remove_symbols): New structure.
	(pass_ipa_remove_symbols): New pass.
	(make_pass_ipa_remove_symbols): New functoin.
	* passes.def (pass_ipa_remove_symbols): Schedule after early passes.

From-SVN: r266315
2018-11-20 13:25:04 +00:00
Richard Biener 8c944c97a2 tree-vect-stmts.c (vectorizable_condition): Do not get at else_clause vect def for EXTRACT_LAST_REDUCTION.
2018-11-20  Richard Biener  <rguenther@suse.de>

	* tree-vect-stmts.c (vectorizable_condition): Do not get
	at else_clause vect def for EXTRACT_LAST_REDUCTION.  Remove
	pointless vect_is_simple_use calls.

From-SVN: r266314
2018-11-20 12:20:40 +00:00
Richard Biener c1d21cd17b re PR tree-optimization/88074 (g++ hangs on math expression)
2018-11-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88074
	* tree-ssa-dom.c (pass_dominator::execute): Do not walk
	backedges.

	* gcc.dg/pr88074.c: New testcase.

From-SVN: r266313
2018-11-20 12:18:58 +00:00
Martin Liska b613740815 Move some i386 C++ tests into g++.target/i386.
2018-11-20  Martin Liska  <mliska@suse.cz>

	* pr57362.C: Move to g++.target/i386 folder.
	* pr57548.C: Likewise.
	* pr59492.C: Likewise.
	* pr82625.C: Likewise.
	* pr85329-2.C: Likewise.
	* pr85329.C: Likewise.

From-SVN: r266312
2018-11-20 12:07:53 +00:00
Ville Voutilainen 47df7e197b Housekeeping for the effective targets of optional's tests.
* testsuite/20_util/optional/77288.cc: Adjust.
* testsuite/20_util/optional/84601.cc: Likewise.
* testsuite/20_util/optional/assignment/1.cc: Likewise.
* testsuite/20_util/optional/assignment/2.cc: Likewise.
* testsuite/20_util/optional/assignment/3.cc: Likewise.
* testsuite/20_util/optional/assignment/4.cc: Likewise.
* testsuite/20_util/optional/assignment/5.cc: Likewise.
* testsuite/20_util/optional/assignment/6.cc: Likewise.
* testsuite/20_util/optional/assignment/7.cc: Likewise.
* testsuite/20_util/optional/assignment/8.cc: Likewise.
* testsuite/20_util/optional/cons/77727.cc: Likewise.
* testsuite/20_util/optional/cons/copy.cc: Likewise.
* testsuite/20_util/optional/cons/deduction.cc: Likewise.
* testsuite/20_util/optional/cons/default.cc: Likewise.
* testsuite/20_util/optional/cons/move.cc: Likewise.
* testsuite/20_util/optional/cons/trivial.cc: Likewise.
* testsuite/20_util/optional/cons/value.cc: Likewise.
* testsuite/20_util/optional/cons/value_neg.cc: Likewise.
* testsuite/20_util/optional/constexpr/cons/default.cc: Likewise.
* testsuite/20_util/optional/constexpr/cons/value.cc: Likewise.
* testsuite/20_util/optional/constexpr/in_place.cc: Likewise.
* testsuite/20_util/optional/constexpr/nullopt.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/1.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/4.cc: Likewise.
* testsuite/20_util/optional/constexpr/observers/5.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/1.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/2.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/3.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/4.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/5.cc: Likewise.
* testsuite/20_util/optional/constexpr/relops/6.cc: Likewise.
* testsuite/20_util/optional/in_place.cc: Likewise.
* testsuite/20_util/optional/make_optional.cc: Likewise.
* testsuite/20_util/optional/nullopt.cc: Likewise.
* testsuite/20_util/optional/observers/1.cc: Likewise.
* testsuite/20_util/optional/observers/2.cc: Likewise.
* testsuite/20_util/optional/observers/3.cc: Likewise.
* testsuite/20_util/optional/observers/4.cc: Likewise.
* testsuite/20_util/optional/observers/5.cc: Likewise.
* testsuite/20_util/optional/observers/6.cc: Likewise.
* testsuite/20_util/optional/relops/1.cc: Likewise.
* testsuite/20_util/optional/relops/2.cc: Likewise.
* testsuite/20_util/optional/relops/3.cc: Likewise.
* testsuite/20_util/optional/relops/4.cc: Likewise.
* testsuite/20_util/optional/relops/5.cc: Likewise.
* testsuite/20_util/optional/relops/6.cc: Likewise.
* testsuite/20_util/optional/relops/7.cc: Likewise.
* testsuite/20_util/optional/requirements.cc: Likewise.
* testsuite/20_util/optional/swap/1.cc: Likewise.
* testsuite/20_util/optional/swap/2.cc: Likewise.
* testsuite/20_util/optional/typedefs.cc: Likewise.

From-SVN: r266310
2018-11-20 12:42:28 +02:00
Jakub Jelinek 72d3bb76c9 re PR bootstrap/88106 (Bootstrap failure on mingw32)
PR bootstrap/88106
	* config/mingw32/affinity-fmt.c: New file.

From-SVN: r266309
2018-11-20 11:39:53 +01:00
Richard Biener b34ac019f8 re PR tree-optimization/88069 (ICE in check_loop_closed_ssa_def, at tree-ssa-loop-manip.c:709)
2018-11-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88069
	* tree-ssa-sccvn.c (visit_phi): Do not value-number to unvisited
	virtual PHI arguments.

	* gcc.dg/pr88069.c: New testcase.

From-SVN: r266308
2018-11-20 10:27:57 +00:00
Martin Liska 48c4096cda Add -fomit-frame-pointer to a test-case (PR ipa/88093).
2018-11-20  Martin Liska  <mliska@suse.cz>

	PR ipa/88093
	* gcc.target/i386/ipa-stack-alignment.c: Add
	-fomit-frame-pointer.

From-SVN: r266307
2018-11-20 10:17:29 +00:00
Ilya Leoshkevich 34a249bc2e S/390: Skip LT(G) peephole when literal pool is involved
By the time peephole optimizations run, we've already made up our mind
whether to use base-register or relative addressing for literal pool
entries.  LT(G) supports only base-register addressing, and so it is
too late to convert L(G)RL + compare to LT(G).  This change should not
make the code worse unless building with e.g. -fno-dce, since comparing
literal pool entries to zero should be optimized away during earlier
passes.

gcc/ChangeLog:

2018-11-20  Ilya Leoshkevich  <iii@linux.ibm.com>

	PR target/88083
	* config/s390/s390.md: Skip LT(G) peephole when literal pool is
	involved.
	* rtl.h (contains_constant_pool_address_p): New function.
	* rtlanal.c (contains_constant_pool_address_p): Likewise.

gcc/testsuite/ChangeLog:

2018-11-20  Ilya Leoshkevich  <iii@linux.ibm.com>

	PR target/88083
	* gcc.target/s390/pr88083.c: New test.

From-SVN: r266306
2018-11-20 09:32:49 +00:00
Richard Biener dc3221e1e3 re PR middle-end/83215 (C++: struct with char-array assumed to alias with everything)
2018-11-20  Richard Biener  <rguenther@suse.de>

	PR middle-end/83215
	* alias.c (component_uses_parent_alias_set_from): Remove
	alias-set zero and TYPE_TYPELESS_STORAGE case both already
	handled in other ways.

	* g++.dg/tree-ssa/pr83215.C: New testcase.

From-SVN: r266305
2018-11-20 09:31:06 +00:00
Eric Botcazou 643427d70f re PR rtl-optimization/85925 (compilation of masking with 257 goes wrong in combine at -02)
PR rtl-optimization/85925
	* rtl.h (word_register_operation_p): New predicate.
	* combine.c (record_dead_and_set_regs_1): Only apply specific handling
	for WORD_REGISTER_OPERATIONS targets to word_register_operation_p RTX.
	* rtlanal.c (nonzero_bits1): Likewise.  Adjust couple of comments.
	(num_sign_bit_copies1): Likewise.

From-SVN: r266302
2018-11-20 08:59:30 +00:00
Richard Biener 07b9f1de1e re PR lto/88087 (ICE in execute at tree-ssa-pre.c:4220 since r266183)
2018-11-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/88087
	* tree-ssa-pre.c (create_expression_by_pieces): Re-materialize
	call fntype.
	* tree-ssa-sccvn.c (copy_reference_ops_from_call): Remember
	call fntype.

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

From-SVN: r266301
2018-11-20 08:06:09 +00:00
Richard Biener 14b6a72109 re PR bootstrap/88089 (build failure with GCC 4.9 on SPARC/Solaris)
2018-11-20  Richard Biener  <rguenther@suse.de>

	PR middle-end/88089
	* tree-data-ref.c (lambda_matrix_right_hermite): Use abs_hwi.

From-SVN: r266300
2018-11-20 08:04:26 +00:00
Paul Koning 6b3be1b4dd align-3.c: Skip if pdp11.
* gcc.c-torture/execute/align-3.c: Skip if pdp11.
	    * gcc.c-torture/execute/pr23467.c: Ditto.
	    * gcc.c-torture/execute/pr36093.c: Ditto.
	    * gcc.c-torture/execute/pr43783.c: Ditto.
	    * gcc.dg/const-elim-2.c: Xfail if pdp11.
	    * gcc.dg/torture/pr36400.c: Ditto.
	    * gcc.dg/tree-ssa/loop-1.c: Xfail for pdp11.  Add pdp11 to check
	    for jsr.

From-SVN: r266299
2018-11-19 20:54:46 -05:00
Paul Koning 327eaaf9c0 target-supports.exp (check_weak_available): Return "no" for pdp11.
* lib/target-supports.exp (check_weak_available): Return "no" for
	pdp11.

From-SVN: r266297
2018-11-19 20:39:08 -05:00
GCC Administrator 9012e65bba Daily bump.
From-SVN: r266293
2018-11-20 00:16:37 +00:00
Alexandre Oliva f4c53af18b PR81878: fix --disable-bootstrap --enable-languages=ada
gnattools build machinery uses just-build xgcc and xg++ as $(CC) and
$(CXX) in native builds.  However, if C and C++ languages are not
enabled, it won't find them.  So, enable C and C++ if Ada is enabled.
Most of the time, this is probably no big deal: C is always enabled
anyway, and C++ is already enabled for bootstraps.

We need not enable those for cross builds, however.  At first I just
took the logic from gnattools/configure, but found it to be lacking:
it would use the just-built tools even in cross-back settings, whose
tools just built for the host would not run on the build machine.  So
I've narrowed down the test to rely on autoconf-detected cross-ness
(build->host only), but also to ensure that host matches build, and
that target matches host.

I've considered sourcing ada/config-lang.in from within
gnattools/configure, and testing lang_requires as set by it, so as to
avoid a duplication of tests that ought to remain in sync, but decided
it would be too fragile, as ada/config-lang.in does not expect srcdir
to refer to gnattools.

for  gcc/ada/ChangeLog

	PR ada/81878
	* gcc-interface/config-lang.in (lang_requires): Set to "c c++"
	when gnattools wants it.

for  gnattools/ChangeLog

	PR ada/81878
	* configure.ac (default_gnattools_target): Do not mistake
	just-built host tools as native in cross-back toolchains.
	* configure: Rebuilt.

From-SVN: r266290
2018-11-20 00:07:47 +00:00
Jan Hubicka 502e897d1a re PR ipa/87957 (ICE tree check: expected tree that contains ‘decl minimal’ structure, have ‘identifier_node’ in warn_odr, at ipa-devirt.c:1051 since r265519)
PR lto/87957
	* ipa-devirt.c (free_enum_values): Do not ICE on ODR vilations.

From-SVN: r266289
2018-11-19 23:27:10 +00:00
Sandra Loosemore 6861fbf6d6 re PR driver/50250 (Driver documentation on -l does not mention shared libraries)
2018-11-19  Sandra Loosemore  <sandra@codesourcery.com>

	PR driver/50250

	gcc/
	* doc/invoke.texi (Link Options): Mention shared libraries
	in documentation for the -l option.  Simplify discussion and
	point to the system linker documentation for details.

From-SVN: r266287
2018-11-19 16:53:09 -05:00
Marek Polacek 9047dd02b8 PR c++/87781 - detect invalid elaborated-type-specifier.
* parser.c (cp_parser_elaborated_type_specifier): Ensure that
	typename follows a nested-name-specifier.

	* g++.dg/parse/elab3.C: New test.
	* g++.dg/template/crash115.C: Adjust dg-error.

From-SVN: r266285
2018-11-19 21:37:01 +00:00
François Dumont 0da4824836 2018-11-19 François Dumont <fdumont@gcc.gnu.org>
* include/ext/throw_allocator.h
	(annotate_base::insert(void*, size_t)): Use insert result to check for
	double insert attempt.
	(annotate_base::insert_construct(void*)): Likewise.
	(annotate_base::check_allocated(void*, size_t)): Return found iterator.
	(annotate_base::erase(void*, size_t)): Use latter method returned
	iterator.
	(annotate_base::check_constructed(void*, size_t)): Return found iterator.
	(annotate_base::erase_construct(void*)): Use latter method returned
	iterator.

From-SVN: r266284
2018-11-19 21:02:17 +00:00
Peter Bergner 4b0f04fba5 re PR rtl-optimization/88033 (ICE on valid code at -O2 and -O3 on x86-64-linux-gnu: in remove_some_program_points_and_update_live_ranges, at lra-lives.c:1179)
gcc/
	PR rtl-optimization/88033
	* ira-lives.c (non_conflicting_reg_copy_p): Skip copies from a register
	to itself.  Use HARD_REGISTER_NUM_P.

gcc/testsuite/
	PR rtl-optimization/88033
	* gcc.target/i386/pr88033.c: New test.

From-SVN: r266282
2018-11-19 13:35:51 -06:00
Kyrylo Tkachov 1fd319753c Disable unrolling for loops vectorised with non-constant VF
This is an alternative to https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00694.html
As richi suggested, this disables unrolling of loops vectorised with variable-length SVE
in the vectoriser itself through the loop->unroll member.

It took me a few tries to get it right, as it needs to be set to '1' to disable unrolling,
the rationale for that mechanism is described in the comment in cfgloop.h.

	* tree-vect-loop.c (vect_transform_loop): Disable further unrolling
	of the loop if vf is non-constant.

	* gcc.target/aarch64/sve/unroll-1.c: New test.

From-SVN: r266281
2018-11-19 17:58:00 +00:00
David Malcolm c95c552804 Fix -fsave-optimization-record ICE (PR tree-optimization/87025)
PR tree-optimization/87025 reports an ICE within
-fsave-optimization-record's optrecord_json_writer.

The issue is that dump_context::begin_scope creates an optinfo
of kind OPTINFO_KIND_SCOPE, but fails to call
dump_context::end_any_optinfo, so the optinfo for the scope remains
pending.

The JSON writer would normally push a JSON array for the "scope" optinfo
when the latter is emitted.  However, if a dump_* call happens that
doesn't flush the "scope" optinfo e.g. dump_printf (as opposed to
dump_printf_loc), that dump_ call is added to the pending optinfo, and
optinfo::handle_dump_file_kind changes the pending optinfo's m_kind
(e.g. to OPTINFO_KIND_NOTE).  Hence when the pending optinfo is
eventually emitted, it isn't OPTINFO_KIND_SCOPE anymore, and hence
the JSON writer doesn't create and push a JSON array for it, leading
to dump_context's view of scopes getting out-of-sync with that of
the JSON writer's.

Later, dump_context::end_scope unconditionally tries to pop the JSON scope
array, but no JSON scope array was added, leading to an assertion
failure (or crash).

The fix is to call dump_context::end_any_optinfo immediately after
creating the scope optinfo, so that it is emitted immediately, ensuring
that the JSON writer stays in-sync with the dump_context.

gcc/ChangeLog:
	PR tree-optimization/87025
	* dumpfile.c (dump_context::begin_scope): Call end_any_optinfo
	immediately after creating the scope optinfo.
	(selftest::test_pr87025): New function.
	(selftest::dumpfile_c_tests): Call it.
	* optinfo-emit-json.cc (optrecord_json_writer::pop_scope): Assert
	that we're not popping the top-level records array.
	* optinfo.cc (optinfo::handle_dump_file_kind): Assert that we're
	not changing the kind of a "scope" optinfo.

gcc/testsuite/ChangeLog:
	PR tree-optimization/87025
	* gcc.dg/pr87025.c: New test.

From-SVN: r266280
2018-11-19 16:42:03 +00:00
David Malcolm 8d1af51684 Eliminate global state from -fsave-optimization-record
As work towards fixing PR tree-optimization/87025, this patch
eliminates global state from optinfo-emit-json.cc in favor
of adding an optional m_json_writer field to dump_context,
replacing the m_forcibly_enable_optinfo flag.

This allows for writing selftests for the interaction of the
JSON-building code with the dumpfile.c code.
In particular, the existing selftest that created optinfo
instances now exercise the JSON-building code (although no
JSON is actually written out).

The patch also simplifies the layering by replacing optinfo::emit ()
with dump_context::emit_optinfo, so that dump_context has
responsibility for keeping track of dump destinations.

gcc/ChangeLog:
	PR tree-optimization/87025
	* dump-context.h: Include "optinfo.h".
	(class optrecord_json_writer): New forward decl.
	(dump_context::forcibly_enable_optinfo_p): Delete.
	(dump_context::optinfo_enabled_p): New member function.
	(dump_context::optimization_records_enabled_p): New member
	function.
	(dump_context::set_json_writer): New member function.
	(dump_context::emit_optinfo): New member function.
	(dump_context::m_forcibly_enable_optinfo): Delete.
	(dump_context::m_json_writer): New member data.
	* dumpfile.c (dump_context::set_json_writer): New member function.
	(dump_context::finish_any_json_writer): New member function.
	(dump_context::end_scope): Replace call to
	optimization_records_maybe_pop_dump_scope with call to
	m_json_writer->pop_scope.
	(dump_context::optinfo_enabled_p): New member function.
	(dump_context::end_any_optinfo): Replace call to optinfo::emit with call
	to dump_context::emit_optinfo.
	(dump_context::emit_optinfo): New member function.
	(temp_dump_context::temp_dump_context): Replace
	m_forcibly_enable_optinfo with call to set_json_writer.
	(temp_dump_context::~temp_dump_context): Clean up any json writer.
	* optinfo-emit-json.cc (class optrecord_json_writer): Move to
	optinfo-emit-json.h
	(the_json_writer): Delete.
	(optimization_records_start): Delete.
	(optimization_records_finish): Delete.
	(optimization_records_enabled_p): Delete, in favor of
	dump_context::optimization_records_enabled_p.
	(optimization_records_maybe_record_optinfo): Delete.
	(optimization_records_maybe_pop_dump_scope): Delete.
	* optinfo-emit-json.h: Include "json.h".  Delete forward
	decl of opt_pass.
	(optimization_records_start): Delete.
	(optimization_records_finish): Delete.
	(optimization_records_enabled_p): Delete.
	(optimization_records_maybe_record_optinfo): Delete.
	(optimization_records_maybe_pop_dump_scope): Delete.
	(class optrecord_json_writer): Move here from
	optinfo-emit-json.cc.
	* optinfo.cc (optinfo::emit_for_opt_problem): Replace call
	to optinfo::emit with call to dump_context::emit_optinfo.
	(optinfo::emit): Delete, in favor of dump_context::emit_optinfo.
	(optinfo_enabled_p): Delete, in favor of
	dump_context::optinfo_enabled_p.
	(optinfo_wants_inlining_info_p): Update for conversion o
	optimization_records_enabled_p to a member function of
	dump_context.
	* optinfo.h (optinfo_enabled_p): Delete, in favor of
	dump_context::optinfo_enabled_p.
	(optinfo::emit): Delete, in favor of dump_context::emit_optinfo.
	* toplev.c: Include "dump-context.h".
	(compile_file): Replace call to optimization_records_finish with
	dump_context::finish_any_json_writer.
	(do_compile): Replace call to optimization_records_start with
	conditionally creating a optrecord_json_writer for the
	dump_context.

From-SVN: r266279
2018-11-19 16:31:03 +00:00
Ville Voutilainen 4fea820523 re PR libstdc++/87855 (std::optional<T> only copy-constructible if T is trivially copy-constructible)
PR libstdc++/87855

Also implement P0602R4 (variant and optional
should propagate copy/move triviality) for std::optional.
* include/std/optional (_Optional_payload): Change
the main constraints to check constructibility in
addition to assignability.
(operator=): Make constexpr.
(_M_reset): Likewise.
(_M_construct): Likewise.
(operator->): Likewise.
* testsuite/20_util/optional/assignment/8.cc: Adjust.
* testsuite/20_util/optional/assignment/9.cc: New.

From-SVN: r266278
2018-11-19 17:05:18 +02:00
Martin Liska f615cb162d Fix condition in lto-symtab.c (PR lto/88077).
2018-11-19  Martin Liska  <mliska@suse.cz>

	PR lto/88077
	* lto-symtab.c (lto_symtab_merge): Transform the
	condition before r256989.
2018-11-19  Martin Liska  <mliska@suse.cz>

	PR lto/88077
	* gcc.dg/lto/pr88077_0.c: New test.
	* gcc.dg/lto/pr88077_1.c: New test.

From-SVN: r266277
2018-11-19 15:00:41 +00:00
Jakub Jelinek 4cb3570c8c re PR tree-optimization/88071 (ICE: verify_gimple failed (error: dead STMT in EH table))
PR tree-optimization/88071
	* tree-vect-loop.c (vectorize_fold_left_reduction): Pass true instead
	of false as last argument to gsi_remove.
	* tree-vect-stmts.c (vect_finish_replace_stmt): Pass true instead of
	false as last argument to gsi_replace.

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

From-SVN: r266276
2018-11-19 15:44:08 +01:00
Jakub Jelinek 3b60ab0aab re PR c++/60994 (gcc does not recognize hidden/shadowed enumeration as valid nested-name-specifier)
PR c++/60994
	* g++.dg/lookup/pr60994.C: New test.

From-SVN: r266275
2018-11-19 15:01:56 +01:00
Jakub Jelinek 4ccc4e3014 re PR debug/87039 (DW_OP_fbreg used without a frame base on a C++ code w/ -fopenmp)
PR debug/87039
	* omp-expand.c: Don't include debug.h.
	(adjust_context_and_scope): Add REGION argument.  Find DECL_CONTEXT
	from innermost outer parallel, task, teams or target that has a
	child_fn set, or, if there is no such outer region, use
	current_function_decl.  Do the DECL_CONTEXT adjustment regardless of
	whether a suitable BLOCK is found or not.
	(expand_parallel_call, expand_teams_call): Don't call
	adjust_context_and_scope here.
	(grid_expand_target_grid_body): Revert 2017-01-25 changes.
	(expand_omp_taskreg, expand_omp_target): Likewise.  Call
	adjust_context_and_scope.
	* dwarf2out.c (dwarf2out_early_global_decl): For
	decl_function_context recurse instead of calling dwarf2out_decl.

	* g++.dg/gomp/pr78363-4.C: New test.
	* g++.dg/gomp/pr78363-5.C: New test.
	* g++.dg/gomp/pr78363-6.C: New test.
	* g++.dg/gomp/pr78363-7.C: New test.

From-SVN: r266272
2018-11-19 14:44:13 +01:00
Richard Biener e48e04f598 re PR c++/87229 (ICE: tree code 'call_expr' is not supported in LTO streams)
2018-11-19  Richard Biener  <rguenther@suse.de>

	PR lto/87229
	* tree.c (free_lang_data_in_one_sizepos): Free non-gimple-val
	sizepos values.

	* g++.dg/lto/pr87229_0.C: New testcase.

From-SVN: r266271
2018-11-19 11:36:51 +00:00
Martin Liska ddd6f407e8 Fix how we match for count(n*) in gcov tests.
2018-11-19  Martin Liska  <mliska@suse.cz>

	* g++.dg/gcov/pr84548.C: Remove remove-gcda.
	* g++.dg/gcov/ternary.C: Likewise.
	* lib/gcov.exp: Support pattern of following form:
	count(1*).

From-SVN: r266270
2018-11-19 11:19:15 +00:00
Jonathan Wakely d86b600d89 PR libstdc++/88084 - Implement LWG 2777
* include/std/string_view (basic_string_view::copy): Use traits to
	copy.
	* testsuite/21_strings/basic_string_view/operations/copy/char/2.cc:
	New test.
	* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/2.cc:
	New test.

From-SVN: r266269
2018-11-19 10:53:59 +00:00
Eric Botcazou 0ea52812a8 compare-elim.c (struct comparison): Add not_in_a field.
* compare-elim.c (struct comparison): Add not_in_a field.
	(is_not): New static function.
	(strip_not): Likewise.
	(conforming_compare): Handle a NOT in the first operand.
	(can_eliminate_compare): Likewise.
	(find_comparison_dom_walker::before_dom_children): Likewise.
	(try_eliminate_compare): Likewise.
	* config/visium/visium.md (negsi2_insn_set_carry): Turn into...
	(neg<mode>2_insn_set_carry): ...this and add missing NEG operation.

From-SVN: r266268
2018-11-19 10:25:35 +00:00
Jonathan Wakely fc315b4769 Fix typos in packed attribute documentation
* doc/extend.texi (Common Type Attributes): Fix typos.

From-SVN: r266267
2018-11-19 09:52:41 +00:00
Eric Botcazou 3087ed26fb Bump copyright year
From-SVN: r266266
2018-11-19 09:52:13 +00:00
Eric Botcazou ad0c3dd296 * gcc-interface/cuintp.c (UI_From_gnu): Remove code for 32-bit hosts.
From-SVN: r266265
2018-11-19 09:47:36 +00:00
Paolo Carlini 4ef3890074 decl2.c (grokfield): Remove obsolete _vptr check; fix explicit template argument list error location.
/cp
2018-11-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl2.c (grokfield): Remove obsolete _vptr check; fix
	explicit template argument list error location.

/testsuite
2018-11-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/template/crash91.C: Check location too.

From-SVN: r266264
2018-11-19 09:33:18 +00:00
Martin Liska 390e529e2b Strenghten assumption about function start and end line (PR gcov-profile/88045).
2018-11-19  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/88045
	* coverage.c (coverage_begin_function): Add assert.
2018-11-19  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/88045
	* g++.dg/gcov/pr88045.C: New test.

From-SVN: r266262
2018-11-19 08:16:17 +00:00
Martin Liska ca44d7f40a Detect mixed usage of spaces and tabs.
2018-11-19  Martin Liska  <mliska@suse.cz>

	* check_GNU_style_lib.py: Detect mixed usage
	of spaces and tabs.

From-SVN: r266261
2018-11-19 08:08:28 +00:00