Commit Graph

169336 Commits

Author SHA1 Message Date
Iain Sandoe 59a0b1db75 [Darwin, fixincludes] Fix Darwin14 header issues.
There are two issues with the Darwin14 (SDK) headers in which unguarded
advanced syntax elements causes any code including these headers to fail.

2019-06-21  Iain Sandoe  <iain@sandoe.co.uk>

	* inclhack.def: Guard __has_attribute and __has_extension in
	os/base.h.
	Guard Apple blocks syntax in dispatch/object.h.
	* fixincl.x: Regenerate.
	* tests/base/dispatch/object.h: New file.
	* tests/base/os/base.h: New file.

From-SVN: r272561
2019-06-21 19:03:45 +00:00
Richard Biener 8d5558c518 re PR tree-optimization/90930 (Excessive memory consumption)
2019-06-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90930
	* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Set visited
	flag on new stmts to avoid re-processing them.

From-SVN: r272560
2019-06-21 18:12:58 +00:00
Matthew Beliveau da9e9b5714 PR c++/90875 - added -Wswitch-outside-range option
* doc/invoke.texi (Wswitch-outside-range): Document.

	* c.opt (Wswitch-outside-range): Added new option.
	* c-warn.c (c_do_switch_warnings): Use OPT_Wswitch-outside-range.

	* c-c++-common/Wswitch-outside-range-1.c: New test.
	* c-c++-common/Wswitch-outside-range-2.c: New test.
	* c-c++-common/Wswitch-outside-range-3.c: New test.
	* c-c++-common/Wswitch-outside-range-4.c: New test.

From-SVN: r272559
2019-06-21 17:50:29 +00:00
Steven G. Kargl 6935293330 re PR fortran/51991 (Wrong error message with variables named "SAVE*")
2019-06-21  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/51991
	* decl.c (gfc_match_save): If SAVE was not seen, return MATCH_NO
	instead issuing an error message and returning MATCH_ERROR.

2019-06-21  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/51991
	gfortran.dg/pr51991.f90

From-SVN: r272556
2019-06-21 16:57:24 +00:00
Jeff Law 84338a1498 re PR tree-optimization/90949 (null pointer check removed)
PR tree-optimization/90949
	* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
	* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.

	* gcc.c-torture/execute/pr90949.c: New test.

From-SVN: r272555
2019-06-21 10:36:00 -06:00
Richard Sandiford 1296eaf6ed Fix missing name in ChangeLog
Fix another case in which a name in the commit message wasn't copied to
the ChangeLog -- sorry!

From-SVN: r272553
2019-06-21 15:02:46 +00:00
Marek Polacek 3f3d6a6fa3 PR c++/90953 - ICE with -Wmissing-format-attribute.
* c-common.c (check_function_arguments_recurse): Use
	get_attribute_name.
	(check_missing_format_attribute): Likewise.

	* g++.dg/warn/miss-format-7.C: New test.

From-SVN: r272552
2019-06-21 14:41:22 +00:00
Richard Sandiford 390549c8a1 Fix missing name in ChangeLog
It was in the commit message but got dropped from the ChangeLog entry
due to a scripting bug.

From-SVN: r272551
2019-06-21 14:38:39 +00:00
Ian Lance Taylor 28b9598b64 compiler: omit write barrier for assignment to *(convert(&local))
Assignments to local variables don't need a write barrier. But
    currently the compiler inserts a write barrier if the LHS is a
    local variable with type converted, as *(convert(&local)). Let
    the compiler recognize this pattern and omit the write barrier.
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182541

From-SVN: r272550
2019-06-21 14:34:26 +00:00
Ian Lance Taylor c9b236e5ca compiler: open code string slice expressions
Currently a string slice expression is implemented with a runtime
    call __go_string_slice. Change it to open code it, which is more
    efficient, and allows the backend to further optimize it.
    
    Also omit the write barrier for length-only update (i.e.
    s = s[:n]).
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/182540

From-SVN: r272549
2019-06-21 14:14:58 +00:00
Richard Biener 050e182a75 re PR debug/90914 (ICE in schedule_generic_params_dies_gen, at dwarf2out.c:27153)
2019-06-21  Richard Biener  <rguenther@suse.de>

	PR debug/90914
	* dwarf2out.c (prune_unused_types_walk): Always consider
	function-local extern declarations as used.

	* g++.dg/debug/pr90914.C: New testcase.

From-SVN: r272547
2019-06-21 13:56:54 +00:00
Richard Biener b614fca25f re PR tree-optimization/90913 (ICE in maybe_gen_insn, at optabs.c:7341 since r272239)
2019-06-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/90913
	* tree-vect-loop-manip.c (vect_loop_versioning): Do not re-use
	the scalar variant of if-conversion versioning.

	* gfortran.dg/vect/pr90913.f90: New testcase.

From-SVN: r272545
2019-06-21 11:10:39 +00:00
Jakub Jelinek 1612b1febd omp-low.c (lower_rec_simd_input_clauses): Add rvar2 argument...
* omp-low.c (lower_rec_simd_input_clauses): Add rvar2 argument,
	create another "omp scan inscan exclusive" array if
	!ctx->scan_inclusive.
	(lower_rec_input_clauses): Handle exclusive scan inscan reductions.
	(lower_omp_scan): Likewise.
	* tree-vectorizer.h (struct _stmt_vec_info): Use 3-bit instead of
	2-bit bitfield for simd_lane_access_p member.
	* tree-vect-data-refs.c (vect_analyze_data_refs): Also handle
	aux == (void *)-4 as simd lane access.
	* tree-vect-stmts.c (check_scan_store): Handle exclusive scan.  Update
	comment with permutations to show the canonical permutation order.
	(vectorizable_scan_store): Handle exclusive scan.
	(vectorizable_store): Call vectorizable_scan_store even for
	STMT_VINFO_SIMD_LANE_ACCESS_P > 3.

	* gcc.dg/vect/vect-simd-12.c: New test.
	* gcc.dg/vect/vect-simd-13.c: New test.
	* gcc.dg/vect/vect-simd-14.c: New test.
	* gcc.dg/vect/vect-simd-15.c: New test.
	* gcc.target/i386/sse2-vect-simd-12.c: New test.
	* gcc.target/i386/sse2-vect-simd-13.c: New test.
	* gcc.target/i386/sse2-vect-simd-14.c: New test.
	* gcc.target/i386/sse2-vect-simd-15.c: New test.
	* gcc.target/i386/avx2-vect-simd-12.c: New test.
	* gcc.target/i386/avx2-vect-simd-13.c: New test.
	* gcc.target/i386/avx2-vect-simd-14.c: New test.
	* gcc.target/i386/avx2-vect-simd-15.c: New test.
	* gcc.target/i386/avx512f-vect-simd-12.c: New test.
	* gcc.target/i386/avx512f-vect-simd-13.c: New test.
	* gcc.target/i386/avx512f-vect-simd-14.c: New test.
	* gcc.target/i386/avx512bw-vect-simd-15.c: New test.
	* g++.dg/vect/simd-6.cc: New test.
	* g++.dg/vect/simd-7.cc: New test.
	* g++.dg/vect/simd-8.cc: New test.
	* g++.dg/vect/simd-9.cc: New test.
	* c-c++-common/gomp/scan-2.c: Don't expect any diagnostics.

From-SVN: r272544
2019-06-21 08:48:57 +02:00
Jakub Jelinek e73fb06d5a re PR c++/90950 (OpenMP clause handling rejecting references to incomplete types in templates)
PR c++/90950
	* semantics.c (finish_omp_clauses): Don't reject references to
	incomplete types if processing_template_decl.

	* g++.dg/gomp/lastprivate-1.C: New test.

From-SVN: r272543
2019-06-21 08:46:45 +02:00
Jakub Jelinek 080c269b61 tree-vect-data-refs.c (vect_find_stmt_data_reference): Handle "omp simd array" arrays with one byte elements.
* tree-vect-data-refs.c (vect_find_stmt_data_reference): Handle
	"omp simd array" arrays with one byte elements.

	* gcc.dg/vect/vect-simd-11.c: New test.
	* gcc.target/i386/sse2-vect-simd-11.c: New test.
	* gcc.target/i386/avx2-vect-simd-11.c: New test.
	* gcc.target/i386/avx512bw-vect-simd-11.c: New test.

From-SVN: r272542
2019-06-21 08:45:59 +02:00
GCC Administrator da10d7c27a Daily bump.
From-SVN: r272538
2019-06-21 00:16:20 +00:00
Marek Polacek 7bfe2b4b78 re PR c++/79781 (ICE on valid C++ code with -std=c++14 (in assemble_integer, at varasm.c:2733))
PR c++/79781
	* g++.dg/ext/goto1.C: New test.

From-SVN: r272527
2019-06-20 22:35:34 +00:00
Steven G. Kargl 2cf4aa79c8 re PR fortran/77632 ([F08] Pointer initialisation does not quite work with arrays)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77632
	* /decl.c (variable_decl): Mark a variable that is a target in pointer
	initialization when in PROGRAM, MODULE, or SUBMODULE scope with an
	implicit save.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77632
	* gfortran.dg/pr77632_1.f90: New test.

From-SVN: r272526
2019-06-20 22:16:29 +00:00
Marek Polacek c35f57c5bd re PR c++/68265 (Arbitrary syntactic nonsense silently accepted after 'int (*){}' until the next close brace)
PR c++/68265
	* g++.dg/parse/error62.C: New test.

From-SVN: r272525
2019-06-20 22:06:36 +00:00
Steven G. Kargl 966e7f731e re PR fortran/86587 (Derived-type with attributes BIND(C) and PRIVATE raises an error but standard accepts it)
2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86587
	* symbol.c (verify_bind_c_derived_type): Remove erroneous error
	checking for BIND(C) and PRIVATE attributes.

2019-06-20  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/86587
	* gfortran.dg/pr86587.f90: New test.

From-SVN: r272524
2019-06-20 21:39:43 +00:00
Uros Bizjak 145f748f0c alpha.md (@unaligned_store<mode>): Rename from unaligned_store<mode>.
* config/alpha/alpha.md (@unaligned_store<mode>):
	Rename from unaligned_store<mode>.
	(@reload_in<mode>_aligned): Rename from reload_in<mode>_aligned.
	* config/alpha/sync.md (@load_locked_<mode>): Rename
	from load_locked_<mode>.
	(@store_conditional_<mode>): Rename from store_conditional_<mode>.
	(@atomic_compare_and_swap<mode>_1): Rename
	from atomic_compare_and_swap<mode>_1.
	(@atomic_exchange<mode>_1): Rename from atomic_exchange<mode>_1.
	* config/alpha/alpha.c (alpha_expand_mov_nobwx):
	Use gen_reload_in_aligned and gen_unaligned_store.
	(emit_load_locked): Remove.
	(emit_store_conditional): Ditto.
	(alpha_split_atomic_op): Use gen_load_locked and gen_store_conditional.
	(alpha_split_compare_and_swap): Ditto.
	(alpha_expand_compare_and_swap_12): Use gen_atomic_compare_and_swap_1.
	(alpha_split_compare_and_swap_12): Use gen_load_locked
	and gen_store_conditional.
	(alpha_split_atomic_exchange): Ditto.
	(alpha_expand_atomic_exchange_12): Use gen_atomic_exchange_1.
	(alpha_split_atomic_exchange_12): Use gen_load_locked
	and gen_store_conditional.

From-SVN: r272523
2019-06-20 23:07:38 +02:00
Janne Blomqvist 6bd4871707 libfortran/65921: Add forgotten PR number to ChangeLog
2019-06-14  Janne Blomqvist  <jb@gcc.gnu.org>

        PR fortran/65921
        * runtime/memory.c (SIZE_MAX):Remove macro definition.
        (xmallocarray): Use __builtin_mul_overflow.

From-SVN: r272520
2019-06-20 23:26:39 +03:00
Iain Sandoe b7a0332ccd [objective-c/c++, testsuite] Fix stubify tests for -fnext-runtime.
These tests were broken in the first place, and more broken following
the change to drop pic symbol stubs unless the linker needs them.

Fixed to work for x86 as well as powerpc and amended the options to
force pic symbol stubs on.

gcc/testsuite/

2019-06-20  Iain Sandoe  <iain@sandoe.co.uk>

	* obj-c++.dg/stubify-1.mm: Adjust options and scan-asm checks.
	* obj-c++.dg/stubify-2.mm: Likewise.
	* objc.dg/stubify-1.m: Likewise.
	* objc.dg/stubify-2.m: Likewise.

From-SVN: r272518
2019-06-20 19:15:58 +00:00
Richard Earnshaw 91bed1a15a [aarch64] Refactor common errata work-around specs
With the addition of the AArch64 NetBSD support code we now have four
ports all using and defining the same errata work-around headers.
That's silly and long-term becomes a maintenance burden.

This patch factors all that code into a single header to eliminate all
the duplication.

	* config/aarch64/aarch64-errata.h: New file.
	* config/aarch64/aarch64-elf-raw.h (CA53_ERR_835769_SPEC): Delete.
	(CA53_ERR_843419_SPEC): Delete.
	(LINK_SPEC): Use AARCH64_ERRATA_LINK_SPEC instead of above.
	* config/aarch64/aarch64-linux.h: Likewise.
	* config/aarch64/aarch64-netbsd.h: Likewise.
	* config/aarch64/aarch64-freebsd.h: Likewise.

From-SVN: r272515
2019-06-20 17:27:06 +00:00
Marek Polacek ceb76ffc6b * config/sh/sh.c (sh2a_function_vector_p): Use get_attribute_name.
From-SVN: r272514
2019-06-20 17:12:38 +00:00
Michael Meissner 7ca50393b3 rs6000.md (isa attribute): Add support for for a future processor.
2019-06-20  Michael Meissner  <meissner@linux.ibm.com>

	* config/rs6000/rs6000.md (isa attribute): Add support for
	for a future processor.

From-SVN: r272513
2019-06-20 17:10:51 +00:00
Marek Polacek 7772dbe2fa re PR c++/87512 (Error: the type ‘const auto’ of ‘constexpr’ variable is not literal)
PR c++/87512
	* g++.dg/cpp1z/inline-var7.C: New test.

From-SVN: r272512
2019-06-20 15:37:35 +00:00
H.J. Lu ac17302495 i386: Generate standard floating point scalar operation patterns
Standard floating point scalar operation patterns for combiner, which
preserve the rest of the vector, look like

     (vec_merge:V2DF
       (vec_duplicate:V2DF (reg:DF 87))
       (reg/v:V2DF 85 [ x ])
       (const_int 1 [0x1])]))

and

     (vec_merge:V2DF
       (vec_duplicate:V2DF
         (op:DF (vec_select:DF (reg/v:V2DF 85 [ x ])
                (parallel [ (const_int 0 [0])]))
         (reg:DF 87))
       (reg/v:V2DF 85 [ x ])
       (const_int 1 [0x1])]))

This patch adds and generates such standard floating point scalar
operation patterns for +, -, *, /, > and <.

Tested on x86-64.

gcc/

	PR target/54855
	* config/i386/i386-expand.c (ix86_expand_vector_set): Generate
	standard scalar operation pattern for V2DF.
	* config/i386/sse.md (*<sse>_vm<plusminus_insn><mode>3): New.
	(*<sse>_vm<multdiv_mnemonic><mode>3): Likewise.
	(*ieee_<ieee_maxmin><mode>3): Likewise.
	(vec_setv2df_0): Likewise.

gcc/testsuite/

	PR target/54855
	* gcc.target/i386/pr54855-1.c: New test.
	* gcc.target/i386/pr54855-2.c: Likewise.
	* gcc.target/i386/pr54855-3.c: Likewise.
	* gcc.target/i386/pr54855-4.c: Likewise.
	* gcc.target/i386/pr54855-5.c: Likewise.
	* gcc.target/i386/pr54855-6.c: Likewise.
	* gcc.target/i386/pr54855-7.c: Likewise.
	* gcc.target/i386/pr54855-8.c: Likewise.
	* gcc.target/i386/pr54855-9.c: Likewise.
	* gcc.target/i386/pr54855-10.c: Likewise.

From-SVN: r272511
2019-06-20 08:30:54 -07:00
Jan Hubicka d1a7d8de46 tree-ssa-alias.c (aliasing_component_refs_p): Remove ref2_is_decl parameter; it has no use in gimple memory model.
* tree-ssa-alias.c (aliasing_component_refs_p): Remove ref2_is_decl
	parameter; it has no use in gimple memory model.
	(indirect_ref_may_alias_decl_p): Update.

	* gcc.c-torture/execute/alias-access-path-1.c: New testcase.

From-SVN: r272510
2019-06-20 14:18:02 +00:00
Jonathan Wakely 86f73527aa Skip libstdc++ debug build in early bootstrap stages
As mentioned in PR 90770, this is a patch that Debian have been carrying
for some time. The additional unoptimized copies of libstdc++ libs that
get built during each stage are never going to be used, so don't bother
building them.

For a profiled bootstrap this means we won't train the compiler on the
unoptimized library code with assertions enabled, but that doesn't seem
like a big problem, as the same code has already been compiled once for
the main libstdc++ library.

	* acinclude.m4 (GLIBCXX_ENABLE_DEBUG): Only do debug build for final
	stage of bootstrap.
	* configure: Regenerate.

From-SVN: r272509
2019-06-20 15:17:57 +01:00
Jonathan Wakely d306dee31d Qualify calls to __never_valueless in <variant>
* include/std/variant (_Variant_storage, _Extra_visit_slot_needed):
	Qualify calls to __never_valueless.

From-SVN: r272508
2019-06-20 15:17:51 +01:00
Marek Polacek 73b7f10a55 re PR c++/89873 (internal compiler error: unexpected expression of kind implicit_conv_expr)
PR c++/89873
	* g++.dg/cpp1y/noexcept1.C: New test.

From-SVN: r272507
2019-06-20 12:22:25 +00:00
Thomas Koenig 877ef62879 re PR fortran/90937 (ICE: in gfc_get_symbol_decl, at fortran/trans-decl.c:1538)
2019-06-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/90937
	* trans-types.c (get_formal_from_actual_arglist): Get symbol from
	current namespace so it will be freed later.  If symbol is of type
	character, get an empty character length.

2019-06-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/90937
	* gfortran.dg/external_procedure_4.f90: New test.

From-SVN: r272506
2019-06-20 11:56:50 +00:00
Tom de Vries 1194e1971a [testsuite] Add missing dg-require-effective-target global_constructor
Add missing dg-require-effective-target global_constructor.

Tested on nvptx.

2019-06-20  Tom de Vries  <tdevries@suse.de>

	* gcc.dg/pr90866-2.c: Require global_constructor.

From-SVN: r272505
2019-06-20 10:37:18 +00:00
Tom de Vries ebbab6f82c [testsuite] Add missing dg-require-effective-target nonlocal_goto
Add missing dg-require-effective-target nonlocal_goto.

Tested on nvptx.

2019-06-20  Tom de Vries  <tdevries@suse.de>

	* gcc.c-torture/compile/pr89280.c: Require nonlocal_goto.
	* gcc.dg/pr88870.c: Same.
	* gcc.dg/pr90082.c: Same.

From-SVN: r272504
2019-06-20 10:37:05 +00:00
Tom de Vries f75d87ff78 [testsuite] Add missing dg-require-effective-target indirect_jumps
Add missing dg-require-effective-target indirect_jumps.

Tested on nvptx.

2019-06-20  Tom de Vries  <tdevries@suse.de>

	* gcc.dg/pr89737.c: Require indirect_jumps.
	* gcc.dg/torture/pr87693.c: Same.
	* gcc.dg/torture/pr89135.c: Same.
	* gcc.dg/torture/pr90071.c: Same.

From-SVN: r272503
2019-06-20 10:36:49 +00:00
Tom de Vries eb60dc25b1 [testsuite] Add missing dg-require-effective-target label_values
Add missing dg-require-effective-target label_values.

Tested on nvptx.

2019-06-20  Tom de Vries  <tdevries@suse.de>

	* gcc.c-torture/compile/pr89280.c: Require label_values.
	* gcc.dg/pr89737.c: Same.
	* gcc.dg/pr90082.c: Same.
	* gcc.dg/torture/pr89135.c: Same.
	* gcc.dg/torture/pr89247.c: Same.
	* gcc.dg/torture/pr90071.c: Same.

From-SVN: r272502
2019-06-20 10:36:35 +00:00
Tom de Vries a62a1606f9 [testsuite] Add missing dg-require-effective-target alloca
Add missing dg-require-effective-target alloca.

Tested on nvptx.

2019-06-20  Tom de Vries  <tdevries@suse.de>

	* gcc.c-torture/compile/pr77754-1.c: Require alloca.
	* gcc.c-torture/compile/pr77754-2.c: Same.
	* gcc.c-torture/compile/pr77754-3.c: Same.
	* gcc.c-torture/compile/pr77754-4.c: Same.
	* gcc.c-torture/compile/pr77754-5.c: Same.
	* gcc.c-torture/compile/pr77754-6.c: Same.
	* gcc.c-torture/compile/pr87110.c: Same.
	* gcc.c-torture/execute/pr86528.c: Same.
	* gcc.dg/Walloca-larger-than-2.c: Same.
	* gcc.dg/Walloca-larger-than.c: Same.
	* gcc.dg/Warray-bounds-41.c: Same.
	* gcc.dg/Wrestrict-17.c: Same.
	* gcc.dg/Wstrict-overflow-27.c: Same.
	* gcc.dg/Wstringop-truncation-3.c: Same.
	* gcc.dg/pr78902.c: Same.
	* gcc.dg/pr87099.c: Same.
	* gcc.dg/pr87320.c: Same.
	* gcc.dg/pr89045.c: Same.
	* gcc.dg/strlenopt-62.c: Same.
	* gcc.dg/tree-ssa/alias-37.c: Same.

From-SVN: r272501
2019-06-20 10:36:18 +00:00
Jonathan Wakely 9f35dcd405 Fix outdated reference to C++17 draft in the docs
* doc/xml/manual/status_cxx2017.xml: Fix outdated reference to
	C++17 working draft.

From-SVN: r272500
2019-06-20 10:13:03 +01:00
Jonathan Wakely 94872d7f99 Improve tests for std::vector<bool> printer
The current tests wouldn't notice if the vector<bool> contents were
printed in reverse, because it would read the same forwards and
backwards. Change the content so the tests would fail if that happened.

	* testsuite/libstdc++-prettyprinters/simple.cc: Use non-palindromic
	vector<bool> for test.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

From-SVN: r272499
2019-06-20 10:04:55 +01:00
Martin Liska d84ea910c9 Decrease hash-table-verification-limit from 100 to 10.
2019-06-20  Martin Liska  <mliska@suse.cz>

	* params.def (PARAM_HASH_TABLE_VERIFICATION_LIMIT): Decrease
	to 10.

From-SVN: r272498
2019-06-20 07:41:42 +00:00
Jakub Jelinek 48b63a31f8 tree-vect-stmts.c (enum scan_store_kind): New type.
* tree-vect-stmts.c (enum scan_store_kind): New type.
	(scan_store_can_perm_p): Change last argument from int * to
	vec<enum scan_store_kind> *, record precisely which permutations
	need whole vector left shift or that plus VEC_COND_EXPR.
	(vectorizable_scan_store): Adjust caller, use whole vector left shift
	and additional VEC_COND_EXPR only for those iterations that need it.

From-SVN: r272497
2019-06-20 09:06:08 +02:00
Alexandre Oliva 170f2d181d fix ARM --with-fpu option checking and error message
Fix the test for failure in parsecpu's checking of the --with-fpu
argument, and the error message that gets printed when the check
fails.

for  gcc/ChangeLog

	* config.gcc: Fix ARM --with-fpu checking and error message.

From-SVN: r272496
2019-06-20 05:55:34 +00:00
GCC Administrator 4eb1b87f95 Daily bump.
From-SVN: r272495
2019-06-20 00:16:14 +00:00
Jonathan Wakely 638ad333ec Fix non-standard behaviour of std::istream_iterator
The current implementation of istream_iterator allows the iterator to be
reused after reaching end-of-stream, so that subsequent reads from the
stream can succeed (e.g. if the stream state has been cleared and stream
position changed from EOF). The P0738R2 paper clarified that the
expected behaviour is to set the stream pointer to null after reaching
end-of-stream, preventing further reads.

This implements that requirement, and adds the new default constructor
to std::ostream_iterator.

	* include/bits/stream_iterator.h (istream_iterator::_M_equal()): Make
	private.
	(istream_iterator::_M_read()): Do not check stream state before
	attempting extraction. Set stream pointer to null when extraction
	fails (P0738R2).
	(operator==(const istream_iterator&, const istream_iterator&)): Change
	to be a hidden friend of istream_iterator.
	(operator!=(const istream_iterator&, const istream_iterator&)):
	Likewise.
	(ostream_iterator::ostream_iterator()): Add default constructor.
	(ostream_iterator::ostream_iterator(ostream_type*, const C*)): Use
	addressof.
	* testsuite/24_iterators/istream_iterator/1.cc: New test.
	* testsuite/24_iterators/ostream_iterator/1.cc: New test.
	* testsuite/24_iterators/ostream_iterator/70766.cc: Also check
	constructor taking a string.
	* testsuite/24_iterators/ostream_iterator/requirements/constexpr.cc:
	New test.

From-SVN: r272491
2019-06-19 23:57:10 +01:00
Michael Weghorn 36d0dada67 Have std::vector printer's iterator return bool for vector<bool>
Have the pretty-printer for 'std::vector<bool>' return a
value of type 'bool' rather than an 'int'.

This way, the type is clear and that can be used for better
display and a 'gdb.Value' constructed from the returned value
will have type 'bool' again, not e.g. 'long long' as happened
previously (at least with GDB 8.2.1 on amd64).

2019-06-19  Michael Weghorn  <m.weghorn@posteo.de>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/90945
	* python/libstdcxx/v6/printers.py (StdVectorPrinter._iterator): Use
	values of type bool for vector<bool> elements.
	* testsuite/libstdc++-prettyprinters/simple.cc: Test vector<bool>.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>

From-SVN: r272490
2019-06-19 23:57:06 +01:00
Jonathan Wakely 0fd9e8482e PR libstdc++/90920 restore previous checks for empty ranges
The change in r263433 broke the contract of the __rotate functions, by no
longer accepting empty ranges. That means that callers which inlined the
old version of std::rotate (without checks) that end up linking to a new
definition of std::__rotate (also without checks) could perform a divide
by zero and crash.

This restores the old contract of the __rotate overloads.

	PR libstdc++/90920 partially revert r263433
	* include/bits/stl_algo.h (__rotate): Restore checks for empty ranges.
	(rotate): Remove checks.
	* testsuite/25_algorithms/rotate/90920.cc: New test.

From-SVN: r272489
2019-06-19 23:57:02 +01:00
Martin Sebor c6f0626b11 re PR tree-optimization/90626 (fold strcmp(a, b) == 0 to zero when one string length is exact and the other is unequal)
PR tree-optimization/90626

gcc/ChangeLog:
	* tree-ssa-strlen.c (strxcmp_unequal): Fix typos.

From-SVN: r272487
2019-06-19 15:46:09 -06:00
Marek Polacek 1bf32c1141 PR c++/60364 - noreturn after first decl not diagnosed.
* attribs.c (get_attribute_namespace): No longer static.
	(decl_attributes): Avoid shadowing.  Preserve the C++11 form for C++11
	attributes.
	(attr_noreturn_exclusions): Make it extern.
	* attribs.h (get_attribute_namespace): Declare.
	* tree-inline.c (function_attribute_inlinable_p): Use
	get_attribute_name.

	* c-attribs.c (handle_noreturn_attribute): No longer static.
	* c-common.h (handle_noreturn_attribute, attr_noreturn_exclusions):
	Declare.
	* c-format.c (check_function_format): Use get_attribute_name.

	* decl.c (duplicate_decls): Give an error when a function is
	declared [[noreturn]] after its first declaration.
	* parser.c (cp_parser_std_attribute): Don't treat C++11 noreturn
	attribute as equivalent to GNU's.
	* tree.c (std_attribute_table): Add noreturn.

	* g++.dg/warn/noreturn-8.C: New test.
	* g++.dg/warn/noreturn-9.C: New test.
	* g++.dg/warn/noreturn-10.C: New test.
	* g++.dg/warn/noreturn-11.C: New test.

From-SVN: r272486
2019-06-19 21:27:45 +00:00
Martin Sebor 4b4a26731e PR tree-optimization/90626 - fold strcmp(a, b) == 0 to zero when one string length is exact and the other is unequal
gcc/ChangeLog:

	PR tree-optimization/90626
	* tree-ssa-strlen.c (strxcmp_unequal): New function.
	(handle_builtin_string_cmp): Call it.

gcc/testsuite/ChangeLog:

	PR tree-optimization/90626
	* gcc.dg/strlenopt-65.c: New test.
	* gcc.dg/strlenopt-66.c: New test.
	* gcc.dg/strlenopt.h (strcmp, strncmp): Declare.

From-SVN: r272485
2019-06-19 14:37:41 -06:00