summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update LOCAL_PATCHES after libsanitizer merge.Martin Liska2018-10-312-4/+7
| | | | | | | | 2018-10-31 Martin Liska <mliska@suse.cz> * LOCAL_PATCHES: Update to installed revisions. From-SVN: r265673
* [ARC] Remove non standard funcions calls.Claudiu Zissulescu2018-10-317-152/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace all custom "library" calls with compiler known patterns. gcc/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * config/arc/arc.md (mulsi3): Remove call to mulsi_600_lib. (mulsi3_600_lib): Remove pattern. (umulsi3_highpart_600_lib_le): Likewise. (umulsi3_highpart): Remove call to umulsi3_highpart_600_lib_le. (umulsidi3): Remove call to umulsidi3_600_lib. (umulsidi3_600_lib): Remove pattern. (peephole2): Remove peephole using the above deprecated patterns. testsuite/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * gcc.target/arc/mulsi3_highpart-2.c: Update test. libgcc/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * config/arc/lib1funcs.S (_muldi3): New function. * config/arc/t-arc (LIB1ASMFUNCS): Add _muldi3. From-SVN: r265672
* Update test-suite expected output after rewording in libsanitizer.Martin Liska2018-10-315-4/+11
| | | | | | | | | | | 2018-10-31 Martin Liska <mliska@suse.cz> * c-c++-common/ubsan/pr63839.c: Update to new sanitizer message. * c-c++-common/ubsan/unreachable-1.c (main): Likewise. * c-c++-common/ubsan/unreachable-2.c: Likewise. * c-c++-common/ubsan/unreachable-4.c (main): Likewise. From-SVN: r265670
* New local GCC patch for CAN_SANITIZE_UB ifdef.Martin Liska2018-10-312-0/+7
| | | | | | | | | 2018-10-31 Martin Liska <mliska@suse.cz> * ubsan/ubsan_platform.h: Add ifndef as we define it with -DCAN_SANITIZE_UB CFLAGS. From-SVN: r265669
* Revert https://reviews.llvm.org/D40908 which changes asan offset to 1<<44.Martin Liska2018-10-312-1/+5
| | | | | | | | 2018-10-31 Martin Liska <mliska@suse.cz> * asan/asan_mapping.h: Revert shadow memory offset to 1 << 41. From-SVN: r265668
* Apply LOCAL_PATCHES and remove not used ones.Martin Liska2018-10-317-24/+41
| | | | | | | | | | | | | | | | | | | 2018-10-31 Martin Liska <mliska@suse.cz> * LOCAL_PATCHES: Update patch list. * asan/asan_globals.cc (CheckODRViolationViaIndicator): Apply patches from GCC's trunk. (CheckODRViolationViaPoisoning): Likewise. (RegisterGlobal): Likewise. * sanitizer_common/sanitizer_mac.cc (defined): Likewise. * sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Likewise. * ubsan/ubsan_handlers.cc (__ubsan::__ubsan_handle_cfi_bad_icall): Likewise. (__ubsan::__ubsan_handle_cfi_bad_icall_abort): Likewise. * ubsan/ubsan_handlers.h (struct CFIBadIcallData): Likewise. (struct CFICheckFailData): Likewise. (RECOVERABLE): Likewise. From-SVN: r265667
* Update build system: include new files and run autoheader, autoconf, automakeMartin Liska2018-10-319-27/+88
| | | | | | | | | | | | | | | | | 2018-10-31 Martin Liska <mliska@suse.cz> * config.h.in: Regenerate. * configure: Likewise. * sanitizer_common/Makefile.am: Include new files, remove old files. * sanitizer_common/Makefile.in: Regenerate. * ubsan/Makefile.am: Include new files, remove old files. * ubsan/Makefile.in: Likewise. * asan/Makefile.am: Include new files. * asan/Makefile.in: Regenerate. From-SVN: r265666
* backport: All source files: Merge from upstream 345033.Martin Liska2018-10-31240-3391/+25041
| | | | | | | | | | Merge from upstream 345033. 2018-10-31 Martin Liska <mliska@suse.cz> * All source files: Merge from upstream 345033. From-SVN: r265665
* Update merge script and HOWTO_MERGE documentation.Martin Liska2018-10-313-5/+15
| | | | | | | | | 2018-10-31 Martin Liska <mliska@suse.cz> * HOWTO_MERGE: Enhance documentation. * merge.sh: Add support for git as well. From-SVN: r265664
* Fix hash-table violation in trans-decl.c.Martin Liska2018-10-312-1/+10
| | | | | | | | | 2018-10-31 Martin Liska <mliska@suse.cz> * trans-decl.c (struct module_hasher): Call htab_hash_string for s->name and not for s. From-SVN: r265663
* Fix PR87374: ICE with -mslow-flash-data and -mword-relocationsThomas Preud'homme2018-10-3114-10/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC ICEs under -mslow-flash-data and -mword-relocations because there is no way to load an address, both literal pools and MOVW/MOVT being forbidden. This patch gives an error message when both options are specified by the user and adds the according dg-skip-if directives for tests that use either of these options. It also explicitely set the option when in PIC mode as per documentation rather than always check for target_word_relocation together with flag_pic. 2018-10-31 Thomas Preud'homme <thomas.preudhomme@linaro.org> gcc/ PR target/87374 * config/arm/arm.c (arm_option_check_internal): Disable the combined use of -mslow-flash-data and -mword-relocations. (arm_option_override): Enable -mword-relocations if -fpic or -fPIC. * config/arm/arm.md (SYMBOL_REF MOVT splitter): Stop checking for flag_pic. * doc/invoke.texi (-mword-relocations): Mention conflict with -mslow-flash-data. (-mslow-flash-data): Reciprocally. gcc/testsuite/ PR target/87374 * gcc.target/arm/movdi_movt.c: Skip if both -mslow-flash-data and -mword-relocations would be passed when compiling the test. * gcc.target/arm/movsi_movt.c: Likewise. * gcc.target/arm/pr81863.c: Likewise. * gcc.target/arm/thumb2-slow-flash-data-1.c: Likewise. * gcc.target/arm/thumb2-slow-flash-data-2.c: Likewise. * gcc.target/arm/thumb2-slow-flash-data-3.c: Likewise. * gcc.target/arm/thumb2-slow-flash-data-4.c: Likewise. * gcc.target/arm/thumb2-slow-flash-data-5.c: Likewise. * gcc.target/arm/tls-disable-literal-pool.c: Likewise. From-SVN: r265662
* aarch64: Force TImode values into even registersRichard Henderson2018-10-312-4/+11
| | | | | | | | | | | | The LSE CASP instruction requires values to be placed in even register pairs. A solution involving two additional register classes was rejected in favor of the much simpler solution of simply requiring all TImode values to be aligned. * config/aarch64/aarch64.c (aarch64_hard_regno_mode_ok): Force 16-byte modes held in GP registers to use an even regno. From-SVN: r265661
* aarch64: Improve atomic-op lse generationRichard Henderson2018-10-315-272/+122
| | | | | | | | | | | | | | | | | | | | | | Fix constraints; avoid unnecessary split. Drop the use of the atomic_op iterator in favor of the ATOMIC_LDOP iterator; this is simplier and more logical for ldclr aka bic. * config/aarch64/aarch64.c (aarch64_emit_bic): Remove. (aarch64_atomic_ldop_supported_p): Remove. (aarch64_gen_atomic_ldop): Remove. * config/aarch64/atomic.md (atomic_<atomic_optab><ALLI>): Fully expand LSE operations here. (atomic_fetch_<atomic_optab><ALLI>): Likewise. (atomic_<atomic_optab>_fetch<ALLI>): Likewise. (aarch64_atomic_<ATOMIC_LDOP><ALLI>_lse): Drop atomic_op iterator and use ATOMIC_LDOP instead; use register_operand for the input; drop the split and emit insns directly. (aarch64_atomic_fetch_<ATOMIC_LDOP><ALLI>_lse): Likewise. (aarch64_atomic_<atomic_op>_fetch<ALLI>_lse): Remove. (@aarch64_atomic_load<ATOMIC_LDOP><ALLI>): Remove. From-SVN: r265660
* aarch64: Improve swp generationRichard Henderson2018-10-313-47/+24
| | | | | | | | | | | | | | | Allow zero as an input; fix constraints; avoid unnecessary split. * config/aarch64/aarch64.c (aarch64_emit_atomic_swap): Remove. (aarch64_gen_atomic_ldop): Don't call it. * config/aarch64/atomics.md (atomic_exchange<ALLI>): Use aarch64_reg_or_zero. (aarch64_atomic_exchange<ALLI>): Likewise. (aarch64_atomic_exchange<ALLI>_lse): Remove split; remove & from operand 0; use aarch64_reg_or_zero for input; merge ... (@aarch64_atomic_swp<ALLI>): ... this and remove. From-SVN: r265659
* re PR d/87788 (Support D on x86_64-apple-darwin*)Iain Buclaw2018-10-315-0/+115
| | | | | | | | | | | | | | | | | | | | | | ChangeLog: 2018-10-31 Iain Buclaw <ibuclaw@gdcproject.org> PR bootstrap/87788 PR d/87799 * configure: Rebuild. * configure.ac: Disable D on systems where it is known not to work. libphobos/ChangeLog: 2018-10-31 Iain Buclaw <ibuclaw@gdcproject.org> PR bootstrap/87789 PR d/87818 PR d/87819 * configure.tgt: New file. From-SVN: r265658
* aarch64: Improve cas generationRichard Henderson2018-10-314-44/+87
| | | | | | | | | | | | | | | | | | | | Do not zero-extend the input to the cas for subword operations; instead, use the appropriate zero-extending compare insns. Correct the predicates and constraints for immediate expected operand. * config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): New. (aarch64_split_compare_and_swap): Use it. (aarch64_expand_compare_and_swap): Likewise. Remove convert_modes; test oldval against the proper predicate. * config/aarch64/atomics.md (@atomic_compare_and_swap<ALLI>): Use nonmemory_operand for expected. (cas_short_expected_pred): New. (@aarch64_compare_and_swap<SHORT>): Use it; use "rn" not "rI" to match. (@aarch64_compare_and_swap<GPI>): Use "rn" not "rI" for expected. * config/aarch64/predicates.md (aarch64_plushi_immediate): New. (aarch64_plushi_operand): New. From-SVN: r265657
* aarch64: Simplify LSE cas generationRichard Henderson2018-10-314-119/+63
| | | | | | | | | | | | | | | | | | | The cas insn is a single insn, and if expanded properly need not be split after reload. Use the proper inputs for the insn. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Force oldval into the rval register for TARGET_LSE; emit the compare during initial expansion so that it may be deleted if unused. (aarch64_gen_atomic_cas): Remove. * config/aarch64/atomics.md (@aarch64_compare_and_swap<SHORT>_lse): Change =&r to +r for operand 0; use match_dup for operand 2; remove is_weak and mod_f operands as unused. Drop the split and merge with... (@aarch64_atomic_cas<SHORT>): ... this pattern's output; remove. (@aarch64_compare_and_swap<GPI>_lse): Similarly. (@aarch64_atomic_cas<GPI>): Similarly. From-SVN: r265656
* re PR testsuite/87802 (g++.dg/vect/slp-pr87105.cc fails starting with r265522)Richard Biener2018-10-312-2/+7
| | | | | | | | | 2018-10-31 Richard Biener <rguenther@suse.de> PR testsuite/87802 * g++.dg/vect/slp-pr87105.cc: XFAIL for strict alignment targets. From-SVN: r265655
* tree-eh.c (replace_trapping_overflow): Simplify ABS_EXPR case using ABSU_EXPR.Richard Biener2018-10-312-21/+8
| | | | | | | | | 2018-10-31 Richard Biener <rguenther@suse.de> * tree-eh.c (replace_trapping_overflow): Simplify ABS_EXPR case using ABSU_EXPR. From-SVN: r265654
* Add pipeline description for Qualcomm Saphira core.Sameera Deshpande2018-10-314-1/+568
| | | | From-SVN: r265653
* Daily bump.GCC Administrator2018-10-311-1/+1
| | | | From-SVN: r265652
* re PR fortran/85896 (ICE in gfc_convert_constant(): Unexpected type)Thomas Koenig2018-10-304-11/+21
| | | | | | | | | | | | | | | 2018-10-30 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85896 * simplify.c (simplify_min_max): Do not convert the type of the return expression. 2018-10-30 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85896 * gfortran.dg/min_max_type.f90: New test. From-SVN: r265649
* PR middle-end/87041 - -Wformat reading through null pointer on unreachable codeMartin Sebor2018-10-3012-25/+1009
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/ChangeLog: PR middle-end/87041 * gimple-ssa-sprintf.c (format_directive): Use %G to include inlining context. (sprintf_dom_walker::compute_format_length): Avoid setting POSUNDER4K here. (get_destination_size): Handle null argument values. (get_user_idx_format): New function. (sprintf_dom_walker::handle_gimple_call): Handle all printf-like functions, including user-defined with attribute format printf. Use %G to include inlining context. Set POSUNDER4K here. gcc/c-family/ChangeLog: PR middle-end/87041 * c-format.c (check_format_types): Avoid diagnosing null pointer arguments to printf-family of functions. gcc/testsuite/ChangeLog: PR middle-end/87041 * gcc.c-torture/execute/fprintf-2.c: New test. * gcc.c-torture/execute/printf-2.c: Same. * gcc.c-torture/execute/user-printf.c: Same. * gcc.dg/tree-ssa/builtin-fprintf-warn-1.c: Same. * gcc.dg/tree-ssa/builtin-printf-2.c: Same. * gcc.dg/tree-ssa/builtin-printf-warn-1.c: Same. * gcc.dg/tree-ssa/user-printf-warn-1.c: Same. From-SVN: r265648
* * params.def (lto-partitions): Bump from 32 to 128.Jan Hubicka2018-10-302-1/+5
| | | | From-SVN: r265647
* Implement P0892R2, explicit(bool).Marek Polacek2018-10-3026-44/+663
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_explicit_bool. * call.c (add_template_candidate_real): Return if the declaration is explicit and we're only looking for non-converting constructor. * cp-tree.h (lang_decl_fn): Add has_dependent_explicit_spec_p bit. (DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P): New macro. (cp_decl_specifier_seq): Add explicit_specifier field. (build_explicit_specifier, store_explicit_specifier): Declare. * decl.c (grokdeclarator): Call store_explicit_specifier. (build_explicit_specifier): New function. * parser.c (cp_parser_function_specifier_opt) <case RID_EXPLICIT>: Parse C++20 explicit(bool). * pt.c (store_explicit_specifier, lookup_explicit_specifier): New. (tsubst_function_decl): Handle explicit(dependent-expr). * g++.dg/cpp2a/explicit1.C: New test. * g++.dg/cpp2a/explicit10.C: New test. * g++.dg/cpp2a/explicit11.C: New test. * g++.dg/cpp2a/explicit12.C: New test. * g++.dg/cpp2a/explicit13.C: New test. * g++.dg/cpp2a/explicit2.C: New test. * g++.dg/cpp2a/explicit3.C: New test. * g++.dg/cpp2a/explicit4.C: New test. * g++.dg/cpp2a/explicit5.C: New test. * g++.dg/cpp2a/explicit6.C: New test. * g++.dg/cpp2a/explicit7.C: New test. * g++.dg/cpp2a/explicit8.C: New test. * g++.dg/cpp2a/explicit9.C: New test. * testsuite/20_util/any/cons/explicit.cc: Adjust dg-error. * testsuite/20_util/pair/cons/explicit_construct.cc: Likewise. * testsuite/20_util/tuple/cons/explicit_construct.cc: Likewise. From-SVN: r265641
* xfail ira-shrink-wrap-prep tests (PR87708)Segher Boessenkool2018-10-303-5/+11
| | | | | | | | | | | | | | | After r265398, the ira-shrinkwrap-prep-[12].c tests fail on all targets, because the IRA feature tested can only move hard registers down, and we no longer have hard registers for the function parameters at this stage. gcc/testsuite/ PR rtl-optimization/87708 gcc.dg/ira-shrinkwrap-prep-1.c: xfail test. gcc.dg/ira-shrinkwrap-prep-2.c: xfail test. From-SVN: r265639
* * tree.cJan Hubicka2018-10-302-47/+181
| | | | | | | | | | | | | | | | (free_lang_data_d, add_tree_to_fld_list, fld_worklist_push): Move head in file. (free_lang_data_in_type): Forward declare. (fld_type_variant_equal_p): New function. (fld_type_variant): New function (fld_incomplete_types): New hash. (fld_incomplete_type_of): New function (fld_simplfied-type): New function. (free_lang_data_in_decl): Add fld parameter; simplify type of FIELD_DECL (free_lang_data): Allocate and free fld_incomplete_type; update call of free_lang_data_in_decl. From-SVN: r265638
* decl.c (grokdeclarator): Use declarator->id_loc in diagnostic about flexible ↵Paolo Carlini2018-10-3015-21/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | array members. /cp 2018-10-30 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (grokdeclarator): Use declarator->id_loc in diagnostic about flexible array members. /testsuite 2018-10-30 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp1z/has-unique-obj-representations1.C: Test location too. * g++.dg/ext/flexarray-mangle-2.C: Likewise. * g++.dg/ext/flexarray-mangle.C: Likewise. * g++.dg/ext/flexarray-subst.C: Likewise. * g++.dg/ext/flexary10.C: Likewise. * g++.dg/ext/flexary11.C: Likewise. * g++.dg/ext/flexary14.C: Likewise. * g++.dg/ext/flexary16.C: Likewise. * g++.dg/ext/flexary26.C: Likewise. * g++.dg/ext/flexary27.C: Likewise. * g++.dg/ext/flexary7.C: Likewise. * g++.dg/ext/pr71290.C: Likewise. From-SVN: r265636
* * gcov.c (output_lines): Remove duplicate line.Eric Botcazou2018-10-302-2/+4
| | | | From-SVN: r265634
* rs6000.md (bswapdi2): Force address into register if not in indexed or ↵Aaron Sawdey2018-10-304-4/+38
| | | | | | | | | | | | | | | | | indirect form. 2018-10-30 Aaron Sawdey <acsawdey@linux.ibm.com> * config/rs6000/rs6000.md (bswapdi2): Force address into register if not in indexed or indirect form. (bswapdi2_load): Change predicate to indexed_or_indirect_operand. (bswapdi2_store): Ditto. * config/rs6000/rs6000.c (rs6000_force_indexed_or_indirect_mem): New helper function. * config/rs6000/rs6000-protos.h (rs6000_force_indexed_or_indirect_mem): Prototype for helper function. From-SVN: r265632
* extend.texi (optimize): Clarify/expand attribute documentation.Martin Sebor2018-10-302-34/+57
| | | | | | | | | gcc/ChangeLog: * doc/extend.texi (optimize): Clarify/expand attribute documentation. (target, pragma GCC optimize, pragma GCC target): Ditto. From-SVN: r265631
* Add PR markerJeff Law2018-10-301-0/+1
| | | | From-SVN: r265628
* method-serial.cc: Mark varible as potentially unused to silence warning.Nicholas Krause2018-10-302-1/+6
| | | | | | | * method-serial.cc: Mark varible as potentially unused to silence warning. From-SVN: r265627
* PR libstdc++/87809 avoid invalid expressions in exception specificationsJonathan Wakely2018-10-309-5/+188
| | | | | | | | | | | | | | | | | | | | | If the allocator isn't default constructible then checking if the default constructor throws in an exception specification makes the declaration invalid. Use the type trait instead. PR libstdc++/87809 * include/bits/forward_list.h (_Fwd_list_impl::_Fwd_list_impl()): Use trait in exception-specification instead of possibly invalid expression. * include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl()): Likewise. * include/bits/stl_list.h (_List_impl::_List_impl()): Likewise. * include/bits/stl_vector.h (_Vector_impl::_Vector_impl()): Likewise. * testsuite/23_containers/forward_list/cons/87809.cc: New test. * testsuite/23_containers/list/cons/87809.cc: New test. * testsuite/23_containers/vector/bool/cons/87809.cc: New test. * testsuite/23_containers/vector/cons/87809.cc: New test. From-SVN: r265626
* PR libstdc++/87784 fix dynamic_bitset::push_backJonathan Wakely2018-10-303-3/+89
| | | | | | | | | | | | | | | | | | | | | Previously the _M_Nb member was incremented before calling _M_unchecked_set which meant that the bit being set was out of bounds. It either set the wrong bit in an allocated word, or accessed beyond the end of the allocated memory in the _M_w vector. The fix for the bug is to update the _M_Nb member after using it as an index. As an optimisation, when a new block needs to be appended the call to _M_unchecked_set can be avoided by appending a block with the least significant bit already set to the desired value. PR libstdc++/87784 * include/tr2/dynamic_bitset (dynamic_bitset::push_back): When there are no unused bits in the last block, append a new block with the right value so the bit doesn't need to be set. Only increment size after setting the new bit, not before. * testsuite/tr2/dynamic_bitset/pr87784.cc: New test. From-SVN: r265625
* * gcc.dg/tree-ssa/attr-alias.c: Skip if no weak support.Paul Koning2018-10-302-0/+5
| | | | From-SVN: r265624
* Fix __builtin_expect_with_probability documentationJonathan Wakely2018-10-302-5/+10
| | | | | | | * doc/extend.texi: Fix prototype and description of __builtin_expect_with_probability. From-SVN: r265622
* Avoid unnecessarily numbering cloned symbols.Michael Ploujnikov2018-10-3015-31/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2018-10-30 Michael Ploujnikov <michael.ploujnikov@oracle.com> * cgraph.h (clone_function_name_1): Replaced by new clone_function_name_numbered that takes name as string; for privatize_symbol_name_1 use only. (clone_function_name): Renamed to clone_function_name_numbered to be explicit about numbering. (clone_function_name): New two-argument function that does not number its output. (clone_function_name): New three-argument function that takes a number to append to its output. * cgraphclones.c (duplicate_thunk_for_node): (clone_function_name_1): Renamed. (clone_function_name_numbered): Two new functions. (clone_function_name): Improved documentation. (cgraph_node::create_virtual_clone): Use clone_function_name_numbered. * config/rs6000/rs6000.c (make_resolver_func): Ditto. * final.c (final_scan_insn_1): Use the new clone_function_name without numbering. * multiple_target.c (create_dispatcher_calls): Ditto. (create_target_clone): Ditto. * omp-expand.c (grid_expand_target_grid_body): Ditto. * omp-low.c (create_omp_child_function_name): Ditto. * omp-simd-clone.c (simd_clone_create): Ditto. * symtab.c (simd_symtab_node::noninterposable_alias): Use the new clone_function_name without numbering. 2018-10-30 Michael Ploujnikov <michael.ploujnikov@oracle.com> * lto-partition.c (privatize_symbol_name_1): Use clone_function_name_numbered. 2018-10-30 Michael Ploujnikov <michael.ploujnikov@oracle.com> * gcc.dg/tree-prof/cold_partition_label.c: Update for cold section names without numbers. * gcc.dg/tree-prof/section-attr-1.c: Ditto. * gcc.dg/tree-prof/section-attr-2.c: Ditto. * gcc.dg/tree-prof/section-attr-3.c: Ditto. From-SVN: r265621
* Don't allow the pool allocator to be configured to allocate zero-sized objectsRichard Earnshaw2018-10-302-0/+6
| | | | | | | | | | | | | | | | | PR bootstrap/87747 would have been significantly easier to track down if the pool allocator had faulted an attempt to configure it to allocate zero-sized objects. Instead, this slipped through and we later hit memory corruption when the assumed size turned out to be different to the configured size. While, theoretically, there might be a use case for this, it seems unlikely to me that GCC would have such a use. So this patch adds a checking assert that the object size is not zero. * alloc-pool.h (base_pool_allocator <TBlockAllocator>::initialize): Assert that the allocation size is not zero. From-SVN: r265620
* re PR tree-optimization/87800 (CPU2006 416.gamess failed to build with LTO)Richard Biener2018-10-302-2/+12
| | | | | | | | | | 2018-10-30 Richard Biener <rguenther@suse.de> PR tree-optimization/87800 * tree-vect-slp.c (vect_build_slp_tree_2): Reject any non-induction or reduction PHIs. From-SVN: r265619
* Fixes bug 87330 by invoking df_note_add_problem to recompute REG_DEAD and ↵Sameera Deshpande2018-10-302-0/+6
| | | | | | REG_UNUSED notes before analysis. From-SVN: r265618
* libgcc: properly destroy mutexes on VxWorksRasmus Villemoes2018-10-302-1/+6
| | | | | | | | Just as one needs run-time initialization of mutexes, one needs to destroy them properly to allow the OS to release resources associated with the semaphore. From-SVN: r265616
* Fix typo in documentation of __builtin_expect_with_probability.Martin Liska2018-10-302-1/+6
| | | | | | | | | 2018-10-30 Martin Liska <mliska@suse.cz> * doc/extend.texi: Fix typo in documentation of __builtin_expect_with_probability. From-SVN: r265615
* Daily bump.GCC Administrator2018-10-301-1/+1
| | | | From-SVN: r265614
* Fix ICE in get_substring_ranges_for_loc on __FILE__ (PR c++/87721)David Malcolm2018-10-296-3/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR c++/87721 reports a crash in get_substring_ranges_for_loc introduced by r265271, my fix for PR 87562. The new issue occurs when attempting to get a location with a string literal inside a macro in which the first token is __FILE__ (formed via concatenation). Attempting to get the spelling location of __FILE__ fails, leading to NULL for start_ord_map and final_ord_map, and thus a NULL pointer dereference. Given that our "on-demand" substring locations approach reparses the string literals, there isn't a good way to access the locations inside such string literals: attempting to reparse __FILE__ fails with a "missing open quote". This patch applies the easy fix by gracefully rejecting the case where the spelling locations for the start or finish give us NULL maps. gcc/ChangeLog: PR c++/87721 * input.c (get_substring_ranges_for_loc): Detect if linemap_resolve_location gives us a NULL map, and reject this case. gcc/testsuite/ChangeLog: PR c++/87721 * c-c++-common/substring-location-PR-87721.c: New test. * gcc.dg/plugin/diagnostic-test-string-literals-1.c: Add test for PR 87721. * gcc.dg/plugin/diagnostic_plugin_test_string_literals.c (test_string_literals): Fold the index arguments before checking for INTEGER_CST. From-SVN: r265611
* C++: simplify output from suggest_alternatives_forDavid Malcolm2018-10-2940-356/+913
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the C++ FE, after emitting various errors about unrecognized names, the parser can call suggest_alternatives_for and/or suggest_alternative_in_explicit_scope. These can issue zero or more suggestions for the unrecognized name, or various other "note" diagnostics suggesting how to fix the problem. For example, currently g++ emits: t.cc:12:3: error: 'gtk_widget_showall' was not declared in this scope 12 | gtk_widget_showall (w); | ^~~~~~~~~~~~~~~~~~ t.cc:12:3: note: suggested alternative: 'gtk_widget_show_all' 12 | gtk_widget_showall (w); | ^~~~~~~~~~~~~~~~~~ | gtk_widget_show_all This patch consolidates the common case when there is a single candidate, so that the error can issue a fix-it hint directly. This simplifies the above to: t.cc:12:3: error: 'gtk_widget_showall' was not declared in this scope; did you mean 'gtk_widget_show_all'? 12 | gtk_widget_showall (w); | ^~~~~~~~~~~~~~~~~~ | gtk_widget_show_all omitting the second "note" diagnostic. Doing so requires changing the above "suggest_" functions so that rather than being called after "error" and emitting a note directly, they are called before the "error", and return a name_hint, which can contain a suggestion and/or a deferred diagnostic. The "single candidate" case is handled via a suggestion, and the "multiple candidates" case via a new subclass of deferred_diagnostic. There was some complication due to the fact that we don't always have enough location information to issue a fix-it hint. Specifically, for the case in qualified_name_lookup_error, the location is that of the name, but the location of the qualifier prefix isn't reliably available. For some hints, e.g. spell-corrections, the replacement is of the name, and for others, e.g. parent namespaces, it's for the qualified name. The patch addresses this by splitting this case out into a new "suggest_alternatives_in_other_namespaces" function, for which fix-it hints aren't issued. Another complication is that of emitting a note when --param cxx-max-namespaces-for-diagnostic-help is reached. The patch emulates the existing behavior by emitting the note from a deferred_diagnostic. This potentially needs to co-exist with another deferred_diagnostic, so it works as a decorator around any other such deferred_diagnostic. Doing so requires slightly extending class name_hint. On adding test coverage for the various cases, I discovered that after emitting a "FOO is not a namespace-name" error, we also emit a "expected namespace-name before" error. The patch removes this second error for the case where it's redundant, simplifying this case from e.g.: spellcheck-ns.C:10:24: error: 'inner_ms' is not a namespace-name 10 | using namespace outer::inner_ms; | ^~~~~~~~ spellcheck-ns.C:10:24: note: suggested alternative: 'inner_ns' 10 | using namespace outer::inner_ms; | ^~~~~~~~ | inner_ns spellcheck-ns.C:10:32: error: expected namespace-name before ';' token 10 | using namespace outer::inner_ms; | ^ to: spellcheck-ns.C:10:24: error: 'inner_ms' is not a namespace-name; did you mean 'inner_ns'? 10 | using namespace outer::inner_ms; | ^~~~~~~~ | inner_ns include/ChangeLog: * unique-ptr.h (gnu::move): Generalize so it applies to all lvalue references, rather than just to unique_ptr values. gcc/c-family/ChangeLog: * name-hint.h (name_hint::take_deferred): New member function. gcc/c/ChangeLog: * c-decl.c (implicit_decl_warning): Update "is there a suggestion" logic for change to name_hint::operator bool. (undeclared_variable): Likewise. * c-parser.c (c_parser_declaration_or_fndef): Likewise. (c_parser_parameter_declaration): Likewise. gcc/cp/ChangeLog: * cp-name-hint.h: New file. * cp-tree.h (expr_to_string): New decl. (suggest_alternatives_for): Move to cp-name-hint.h, changing return type from bool to name_hint. (suggest_alternative_in_explicit_scope): Likewise. * error.c: Define INCLUDE_UNIQUE_PTR. Include "cp-name-hint.h". (expr_to_string): Make non-static. (qualified_name_lookup_error): For the non-"::" case, take responsibity for issuing any suggestion from suggest_alternative_in_explicit_scope, as it changes from returning a bool to returning a name_hint. Replace fallback call to suggest_alternatives_for to a call to suggest_alternatives_in_other_namespaces, capturing the fact that we don't have enough location information to issue a fix-it hint for this case. Update the error to support emitting a fix-it hint where appropriate. For the "::" case, take responsibility for issuing any suggestion from suggest_alternatives_for, supporting emitting a fix-it hint. * lex.c: Define INCLUDE_UNIQUE_PTR. Include "gcc-rich-location.h" and "cp-name-hint.h". (unqualified_name_lookup_error): Take responsibility for issuing any suggestion from suggest_alternatives_for, supporting emitting a fix-it hint. * name-lookup.c (class namespace_limit_reached): New subclass of deferred_diagnostic. (class show_candidate_location): Likewise. (class suggest_alternatives): Likewise. (class namespace_hints): New class. (suggest_alternatives_for): Convert return type from bool to name_hint, replacing all direct diagnostic emission by setting suggestions on the return value, or creating deferred diagnostics. Specifically, split out initial traversal of namespaces into namespace_hints' ctor, and maybe_decorate_with_limit, and move the rest of the implementation to namespace_hints::convert_candidates_to_name_hint and suggest_alternatives_for_1. (namespace_hints::namespace_hints): New ctor, adapted from suggest_alternatives_for's initial namespace traversal, storing location and name, and converting locals "candidates", "limited" and "limit" into members. (namespace_hints::convert_candidates_to_name_hint): New member function. (namespace_hints::maybe_decorate_with_limit): New member function. (suggest_alternatives_for_1): New function, based on second half of old implementation of suggest_alternatives_for, converting from immediate emission of suggestions to using name_hint. (suggest_alternatives_in_other_namespaces): New function. (maybe_suggest_missing_std_header): Convert from immediate emission of suggestions to using name_hint, moving emission implementation to... (class missing_std_header): New subclass of deferred_diagnostic. (maybe_suggest_missing_header): Convert return type from bool to name_hint. (suggest_alternative_in_explicit_scope): Convert from immediate emission of suggestions to using name_hint. * parser.c: Replace include of "c-family/name-hint.h" with "cp-name-hint.h". (cp_parser_diagnose_invalid_type_name): Update "is there a suggestion" logic for change to name_hint::operator bool. Take responsibility for emitting fix-it hints from suggest_alternative_in_explicit_scope. (cp_parser_namespace_name): Take responsibility for emitting fix-it hints from suggest_alternative_in_explicit_scope. Don't emit the "expected namespace-name" error if we've already emitted an "is not a namespace-name" error. gcc/testsuite/ChangeLog: * c-c++-common/spellcheck-reserved.c: Update expected output for C++ for merger of "did you mean" suggestions into the error message. * g++.dg/ext/builtin3.C: Update expected output for merger of "did you mean" suggestion into the error. * g++.dg/lookup/error1.C: Likewise. * g++.dg/lookup/pr77549.C: Likewise. * g++.dg/lookup/pr80913.C: Likewise. * g++.dg/lookup/suggestions1.C: Likewise. * g++.dg/lookup/suggestions2.C: New test. * g++.dg/overload/koenig1.C: Update expected output as above. * g++.dg/spellcheck-identifiers-2.C: Likewise. * g++.dg/spellcheck-identifiers.C: Likewise. * g++.dg/spellcheck-ns.C: New test. * g++.dg/spellcheck-pr77829.C: Update expected output as above. * g++.dg/spellcheck-pr78656.C: Likewise. * g++.dg/spellcheck-pr79298.C: Likewise, adding -fdiagnostics-show-caret to options. * g++.dg/spellcheck-pr80177.C: Likewise. * g++.dg/spellcheck-single-vs-multiple.C: New test. * g++.dg/spellcheck-typenames.C: Update expected output as above. * g++.dg/template/static10.C: Likewise. * g++.old-deja/g++.mike/ns5.C: Likewise. * g++.old-deja/g++.mike/ns7.C: Likewise. * g++.old-deja/g++.ns/koenig5.C: Likewise. * g++.old-deja/g++.other/lineno5.C: Likewise. libstdc++-v3/ChangeLog: * testsuite/17_intro/using_namespace_std_exp_neg.cc: Remove "expected namespace-name before" error. * testsuite/17_intro/using_namespace_std_tr1_neg.cc: Likewise. From-SVN: r265610
* Folding and check_function_argumentsDavid Malcolm2018-10-294-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch eliminates the arglocs array I introduced to build_over_call in r264887, and eliminates the call to maybe_constant_value when building "fargs" (thus retaining location wrapper nodes). Instead, this patch requires that any checks within check_function_arguments that need folded arguments do their own folding. Of the various checks: (a) check_function_nonnull already calls fold_for_warn, (b) check_function_format doesn't need folding (c) check_function_sentinel needs fold_for_warn in one place, which the patch adds, and (d) check_function_restrict needs per-argument folding, which the patch adds. Given that it scans before and after resetting TREE_VISITED on each argument, it seemed best to make a copy of the array, folding each argument from the outset, rather than repeatedly calling fold_for_warn; gcc/c-family/ChangeLog: PR c++/56856 * c-common.c (check_function_sentinel): Call fold_for_warn on the argument. (check_function_restrict): Rename param "argarray" to "unfolded_argarray", and make a copy named "argarray", calling fold_for_warn on each argument. (check_function_arguments): Add note about responsibility for folding the arguments. gcc/cp/ChangeLog: PR c++/56856 * call.c (build_over_call): Eliminate the "arglocs" array, and the call to maybe_constant_value when building "fargs". From-SVN: r265609
* decl.c (create_array_type_for_decl): Add location_t parameter and use it.Paolo Carlini2018-10-2914-34/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | /cp 2018-10-29 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (create_array_type_for_decl): Add location_t parameter and use it. (grokdeclarator): Adjust call. /testsuite 2018-10-29 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/cpp0x/auto24.C: Test location too. * g++.dg/cpp0x/auto3.C: Likewise. * g++.dg/cpp0x/auto42.C: Likewise. * g++.dg/cpp0x/initlist57.C: Likewise. * g++.dg/cpp0x/initlist75.C: Likewise. * g++.dg/cpp0x/initlist80.C: Likewise. * g++.dg/cpp0x/lambda/lambda-ice13.C: Likewise. * g++.old-deja/g++.brendan/array-refs.C: Likewise. * g++.old-deja/g++.bugs/900322_01.C: Likewise. * g++.old-deja/g++.bugs/900519_07.C: Likewise. * g++.old-deja/g++.other/typeck1.C: Likewise. From-SVN: r265608
* config.gcc (xstormy16-*-elf): Set tm_d_file.Iain Buclaw2018-10-292-0/+5
| | | | | | | | | | gcc/ChangeLog: 2018-10-29 Iain Buclaw <ibuclaw@gdcproject.org> * config.gcc (xstormy16-*-elf): Set tm_d_file. From-SVN: r265607
* ux.texi: move "Quoting" and "Fix-it hints" from DiagnosticsGuidelines wiki pageDavid Malcolm2018-10-292-0/+45
| | | | | | | | | | | | | | | gcc/ChangeLog: * doc/ux.texi (Quoting): New subsection, adapted from material at https://gcc.gnu.org/wiki/DiagnosticsGuidelines written by MartinSebor and ManuelLopezIbanez. (Fix-it hints): Note that fix-it hints shouldn't be marked for translation. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> Co-Authored-By: Martin Sebor <msebor@redhat.com> From-SVN: r265606