summaryrefslogtreecommitdiff
path: root/libiberty
AgeCommit message (Collapse)Author
2018-01-25Update ChangeLog and version files for releaserguenth
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257041 138bc75d-0d04-0410-961f-82ee72b054a4
2017-08-14Update ChangeLog and version files for releaserguenth
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@251081 138bc75d-0d04-0410-961f-82ee72b054a4
2017-05-02Update ChangeLog and version files for releasegccadmin
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@247493 138bc75d-0d04-0410-961f-82ee72b054a4
2017-03-27cplus_demangle_fill_component: Handle DEMANGLE_COMPONENT_RVALUE_REFERENCEpalves
This patch almost a decade ago: ... 2007-08-31 Douglas Gregor <doug.gregor@gmail.com> * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE. (d_make_comp): Ditto. ... ... missed doing the same change to cplus_demangle_fill_component that was done to d_make_comp. I.e., teach it to only validate that we're not passing in a "right" subtree. GDB has recently (finally) learned about rvalue references, and a change to make it use cplus_demangle_fill_component more ran into an assertion because of this. (GDB is the only user of cplus_demangle_fill_component in both the gcc and binutils-gdb trees.) libiberty/ChangeLog: 2017-03-27 Pedro Alves <palves@redhat.com> * cp-demint.c (cplus_demangle_fill_component): Handle DEMANGLE_COMPONENT_RVALUE_REFERENCE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246502 138bc75d-0d04-0410-961f-82ee72b054a4
2017-03-13libiberty: Initialize d_printing in all cplus_demangle_fill_* functions.mark
While integrating the d_printing recursion guard change into gdb I noticed we forgot to initialize the demangle_component d_printing field in cplus_demangle_fill_{name,extended_operator,ctor,dtor}. As is done in cplus_demangle_fill_{component,builtin_type,operator}. It happened to work because in gcc all demangle_components were allocated through d_make_empty. But gdb has its own allocation mechanism (as might other users). libiberty/ChangeLog: * cp-demangle.c (cplus_demangle_fill_name): Initialize demangle_component d_printing. (cplus_demangle_fill_extended_operator): Likewise. (cplus_demangle_fill_ctor): Likewise. (cplus_demangle_fill_dtor): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246105 138bc75d-0d04-0410-961f-82ee72b054a4
2017-03-08Fix PR demangler/70909 and 67264 (endless demangler recursion)trippels
ChangeLog: PR demangler/70909 PR demangler/67264 * include/demangle.h: Add d_printing to struct demangle_component and pass struct demangle_component as non const. libiberty/ChangeLog: PR demangler/70909 PR demangler/67264 * cp-demangle.c: Fix endless recursion. Pass struct demangle_component as non const. (d_make_empty): Initialize variable. (d_print_comp_inner): Limit recursion. (d_print_comp): Decrement variable. * cp-demint.c (cplus_demangle_fill_component): Initialize variable. (cplus_demangle_fill_builtin_type): Likewise. (cplus_demangle_fill_operator): Likewise. * testsuite/demangle-expected: Add tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245978 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-18Fix PR70182 -- missing "on" in mangling of unresolved operatorstrippels
The ABI says: <unresolved-name> ::= [gs] <base-unresolved-name> ::= sr <unresolved-type> <base-unresolved-name> ::= srN <unresolved-type> <unresolved-qualifier-level>+ E <base-unresolved-name> ::= [gs] sr <unresolved-qualifier-level>+ E <base-unresolved-name> <base-unresolved-name> ::= <simple-id> ::= on <operator-name> ::= on <operator-name> <template-args> ::= dn <destructor-name libiberty: PR c++/70182 * cp-demangle.c (d_unqualified_name): Handle "on" for operator names. * testsuite/demangle-expected: Add tests. gcc/cp: PR c++/70182 * mangle.c (write_template_args): Add "on" for operator names. gcc: PR c++/70182 * doc/invoke.texi (fabi-version): Mention mangling fix for operator names. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244567 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-18Fix PR77489 -- mangling of discriminator >= 1trippels
libiberty: PR c++/77489 * cp-demangle.c (d_discriminator): Handle discriminator >= 10. * testsuite/demangle-expected: Add tests for discriminator. gcc: PR c++/77489 * doc/invoke.texi (fabi-version): Document discriminator mangling. gcc/cp: PR c++/77489 * mangle.c (write_discriminator): Handle discriminator >= 10. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244566 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-04 Update copyright years.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244052 138bc75d-0d04-0410-961f-82ee72b054a4
2017-01-04Update configure deps, remove stray \xA0 in picflag.m4, regenerateamodra
Also fix a stray changelog entry. Some of the regen here is due to previous changes not being regenerated properly, in part due to the missing configure dependencies. * configure: Regenerate. config/ * picflag.m4: Remove stray \xA0 in comment. gcc/ * Makefile.in (aclocal_deps): Update and order as per aclocal.m4. * configure: Regenerate. * config.in: Regenerate. libada/ * Makefile.in (configure_deps): Update and order as per configure.ac sinclude. * configure: Regenerate. libgcc/ * Makefile.in (configure_deps): Update. * configure: Regenerate. libiberty/ * Makefile.in (configure_deps): Update. * configure: Regenerate. libitm/ * Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244049 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-13 PR c++/78761jakub
* cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto). * testsuite/demangle-expected: Add test for decltype(auto). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243593 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-12 libiberty/nathan
PR c++/78252 * cp-demangle.c (struct d_print_info): Add is_lambda_arg field. (d_print_init): Initialize it. (d_print_comp_inner) <DEMANGLE_COMPONENT_TEMPLATE_PARAM>: Check is_lambda_arg for auto. <DEMANGLE_COMPONENT_REFERENCE, DEMANGLE_COMPONENT_RVALUE_REFERENCE>: Skip smashing check when is_lambda_arg. <DEMANGLE_COMPONENT_LAMBDA>: Increment is_lambda_arg around arg printing. * testsuite/demangle-expected: Add lambda auto mangling cases. gcc/testsuite/ PR c++/78252 * g++.dg/cpp1y/lambda-mangle-1.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243566 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-06Oops, fix datedj
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243281 138bc75d-0d04-0410-961f-82ee72b054a4
2016-12-06* argv.c (expandargv): Check for directories passed as @-files.dj
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243280 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-30libiberty: avoid reading past end of buffer in strndup/xstrndup (PR c/78498)dmalcolm
gcc/ChangeLog: PR c/78498 * selftest.c (selftest::assert_strndup_eq): New function. (selftest::test_strndup): New function. (selftest::test_libiberty): New function. (selftest::selftest_c_tests): Call test_libiberty. gcc/testsuite/ChangeLog: PR c/78498 * gcc.dg/format/pr78494.c: New test case. libiberty/ChangeLog: PR c/78498 * strndup.c (strlen): Delete decl. (strnlen): Add decl. (strndup): Call strnlen rather than strlen. * xstrndup.c (xstrndup): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@243030 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-29 * cp-demangle.c (d_print_comp_inner): Fix parameter indentation.nathan
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242963 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-16libiberty: Add Rust symbol demangling.mark
Adds Rust symbol demangler. Rust mangles symbols using GNU_V3 style, adding a hash and various special character subtitutions. This adds a new rust style to cplus_demangle and adds 3 helper functions rust_demangle, rust_demangle_sym and rust_is_mangled. rust-demangle.c was written by David. Mark did the code formatting to GNU style and integration into the gcc/libiberty build system and testsuite. include/ChangeLog: 2016-11-03 David Tolnay <dtolnay@gmail.com> Mark Wielaard <mark@klomp.org> * demangle.h (DMGL_RUST): New macro. (DMGL_STYLE_MASK): Add DMGL_RUST. (demangling_styles): Add dlang_rust. (RUST_DEMANGLING_STYLE_STRING): New macro. (RUST_DEMANGLING): New macro. (rust_demangle): New prototype. (rust_is_mangled): Likewise. (rust_demangle_sym): Likewise. libiberty/ChangeLog: 2016-11-03 David Tolnay <dtolnay@gmail.com> Mark Wielaard <mark@klomp.org> * Makefile.in (CFILES): Add rust-demangle.c. (REQUIRED_OFILES): Add rust-demangle.o. * cplus-dem.c (libiberty_demanglers): Add rust_demangling case. (cplus_demangle): Handle RUST_DEMANGLING. (rust_demangle): New function. * rust-demangle.c: New file. * testsuite/Makefile.in (really-check): Add check-rust-demangle. (check-rust-demangle): New rule. * testsuite/rust-demangle-expected: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242524 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-15libiberty: demangler crash with missing :? or fold expression component.mark
When constructing an :? or fold expression that requires a third expression only the first and second were explicitly checked to not be NULL. Since the third expression is also required in these constructs it needs to be explicitly checked and rejected when missing. Otherwise the demangler will crash once it tries to d_print the NULL component. Added two examples to demangle-expected of strings that would crash before this fix. Found by American Fuzzy Lop (afl) fuzzer. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242451 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-15libiberty: Fix some demangler crashes caused by reading past end of input.mark
In various situations the cplus_demangle () function could read past the end of input causing crashes. Add checks in various places to not advance the demangle string location and fail early when end of string is reached. Add various examples of input strings to the testsuite that would crash test-demangle before the fixes. Found by using the American Fuzzy Lop (afl) fuzzer. libiberty/ChangeLog: * cplus-dem.c (demangle_signature): After 'H', template function, no success and don't advance position if end of string reached. (demangle_template): After 'z', template name, return zero on premature end of string. (gnu_special): Guard strchr against searching for zero characters. (do_type): If member, only advance mangled string when 'F' found. * testsuite/demangle-expected: Add examples of strings that could crash the demangler by reading past end of input. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242450 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-15 - Revert last commit, restore the regenerated files aclocal.m4 and configuredoko
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242438 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-15<toplevel>doko
2016-11-15 Matthias Klose <doko@ubuntu.com> * config-ml.in: Remove references to GCJ. * configure.ac: Likewise. * configure: Regenerate. config/ 2016-11-15 Matthias Klose <doko@ubuntu.com> multi.m4: Don't set GCJ. gcc/ 2016-11-15 Matthias Klose <doko@ubuntu.com> * doc/install.texi: Remove references to gcj/libjava. * doc/invoke.texi: Likewise. */ (where necessary) 2016-11-15 Matthias Klose <doko@ubuntu.com> * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242433 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-14libiberty: Add -Wshadow=local to warning flags (if supported).mark
libiberty/ChangeLog: * configure.ac (ac_libiberty_warn_cflags): Add -Wshadow=local. * configure: Regenerated. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242396 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-07Implement P0012R1, Make exception specifications part of the type system.jason
gcc/cp/ * cp-tree.h (enum tsubst_flags): Add tf_fndecl_type. (flag_noexcept_type, ce_type): New. * call.c (build_conv): Add ck_fnptr. (enum conversion_kind): Change ck_tsafe to ck_fnptr. (convert_like_real): Likewise. (standard_conversion): Likewise. Allow function pointer conversions for pointers to member functions. (reference_compatible_p): Allow function pointer conversions. (direct_reference_binding): Likewise. (reference_binding): Reference-compatible is no longer a subset of reference-related. (is_subseq): Also strip ck_lvalue after next_conversion. * class.c (instantiate_type): Check fnptr_conv_p. (resolve_address_of_overloaded_function): Likewise. * cvt.c (can_convert_tx_safety): Now static. (noexcept_conv_p, fnptr_conv_p, strip_fnptr_conv): New. * decl.c (flag_noexcept_type): Define. (cxx_init_decl_processing): Set it. (bad_specifiers): Check it. (grokdeclarator) [cdk_function]: Add exception-spec to type here. * lambda.c (maybe_add_lambda_conv_op): Add exception-spec to returned pointer. * mangle.c (struct globals): Add need_cxx1z_warning. (mangle_decl): Check it. (write_exception_spec): New. (write_function_type): Call it. (canonicalize_for_substitution): Handle exception spec. (write_type): Likewise. (write_encoding): Set processing_template_decl across mangling of partially-instantiated type. * pt.c (determine_specialization): Pass tf_fndecl_type. (tsubst_decl, fn_type_unification): Likewise. (tsubst): Strip tf_fndecl_type, pass it to tsubst_exception_specification. (convert_nontype_argument_function): Handle function pointer conversion. (convert_nontype_argument): Likewise. (unify, for_each_template_parm_r): Walk into noexcept-specifier. * rtti.c (ptr_initializer): Encode noexcept. * tree.c (canonical_eh_spec): New. (build_exception_variant): Use it. * typeck.c (composite_pointer_type): Handle fnptr conversion. (comp_except_specs): Compare canonical EH specs. (structural_comptypes): Call it. gcc/c-family/ * c.opt (Wc++1z-compat): New. * c-cppbuiltin.c (c_cpp_builtins): Add __cpp_noexcept_function_type. libstdc++-v3/ * include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM) (_GLIBCXX_NOEXCEPT_QUAL): New. * include/std/type_traits (is_function): Use them. * libsubc++/new (launder): Likewise. * libsupc++/cxxabi.h (__pbase_type_info::__masks): Add __noexcept_mask. * libsupc++/pbase_type_info.cc (__do_catch): Handle function pointer conversion. libiberty/ * cp-demangle.c (is_fnqual_component_type): New. (d_encoding, d_print_comp_inner, d_print_mod_list): Use it. (FNQUAL_COMPONENT_CASE): New. (d_make_comp, has_return_type, d_print_comp_inner) (d_print_function_type): Use it. (next_is_type_qual): New. (d_cv_qualifiers, d_print_mod): Handle noexcept and throw-spec. include/ * demangle.h (enum demangle_component_type): Add DEMANGLE_COMPONENT_NOEXCEPT, DEMANGLE_COMPONENT_THROW_SPEC. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241944 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-04libiberty: Fix -Wimplicit-fallthrough warnings.mark
Adjust some comments, add some explicit fall through comments or explicit returns where necessary to not get implicit-fallthrough warnings. All fall throughs were deliberate. In one case I added an explicit return false for clarity instead of falling through a default case (that also would return false). libiberty/ChangeLog: * cplus-dem.c (demangle_signature): Move fall through comment. (demangle_fund_type): Add fall through comment between 'G' and 'I'. * hashtab.c (iterative_hash): Add fall through comments. * regex.c (regex_compile): Add Fall through comment after '+'/'?'. (byte_re_match_2_internal): Add Fall through comment after jump_n. Change "Note fall through" to "Fall through". (common_op_match_null_string_p): Return false after set_number_at instead of fall through. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241864 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-02 Implement P0136R1, Rewording inheriting constructors.jason
gcc/c-family/ * c.opt (-fnew-inheriting-ctors): New. * c-opts.c: Default to on for ABI 11+. gcc/cp/ * call.c (enum rejection_reason_code): Add rr_inherited_ctor. (inherited_ctor_rejection): New. (add_function_candidate): Reject inherited ctors for copying. (enforce_access): Use strip_inheriting_ctors. (print_z_candidate): Likewise. Handle rr_inherited_ctor. (convert_like_real): Avoid copying inheriting ctor parameters. (build_over_call): Likewise. A base ctor inheriting from vbase has no parms. Sorry about varargs. (joust): A local constructor beats inherited with the same convs. * class.c (add_method): Handle hiding inheriting ctors. (one_inherited_ctor): Handle new semantics. (add_implicitly_declared_members): Pass using_decl down. (build_clone): A base ctor inheriting from vbase has no parms. * cp-tree.h (DECL_INHERITED_CTOR): Store this instead of the base. (SET_DECL_INHERITED_CTOR): Likewise. (DECL_INHERITED_CTOR_BASE): Adjust. * constexpr.c: Adjust. * error.c (dump_function_decl): Decorate inheriting ctors. * init.c (emit_mem_initializers): Suppress access control in inheriting ctor. * mangle.c (write_special_name_constructor): Handle new inheriting ctor mangling. * method.c (strip_inheriting_ctors, inherited_ctor_binfo) (ctor_omit_inherited_parms, binfo_inherited_from): New. (synthesized_method_walk): Use binfo_inherited_from. Suppress access control in inheriting ctor. (deduce_inheriting_ctor): Deleted if ambiguous ctor inheritance. (maybe_explain_implicit_delete): Explain ambigous ctor inheritance. (add_one_base_init, do_build_copy_constructor): Adjust. (locate_fn_flags, explain_implicit_non_constexpr): Adjust. (implicitly_declare_fn): Adjust. (get_inherited_ctor): Remove. * name-lookup.c (do_class_using_decl): Check for indirect ctor inheritance. * optimize.c (cdtor_comdat_group): Adjust for new mangling. (maybe_clone_body): Handle omitted parms in base clone. (maybe_thunk_body): Don't thunk if base clone omits parms. * pt.c (tsubst_decl): Adjust. (instantiate_template_1): Suppress access control in inheriting ctor. (fn_type_unification): Do deduction with inherited ctor. * tree.c (special_function_p): Adjust. gcc/ * tree-inline.c (copy_tree_body_r): Only copy the taken branch of a COND_EXPR with constant condition. libiberty/ * cp-demangle.c (d_ctor_dtor_name): Handle inheriting constructor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241765 138bc75d-0d04-0410-961f-82ee72b054a4
2016-11-01libiberty: Fix memory leak in ada_demangle when symbol cannot be demangled.mark
When a symbol cannot be demangled in ada_demangle a new demangled VEC will be allocated without deleting the demangled VEC already in use. Running testsuite/test-demangle under valgrind will show the leak for this entry in testsuite/demangle-expected: # Elaborated flag (not demangled) --format=gnat x_E <x_E> 11 bytes in 1 blocks are definitely lost in loss record 1 of 1 at 0x4C27BE3: malloc (vg_replace_malloc.c:299) by 0x413FE7: xmalloc (xmalloc.c:148) by 0x4025EC: ada_demangle (cplus-dem.c:930) by 0x402C59: cplus_demangle (cplus-dem.c:892) by 0x400FEC: main (test-demangle.c:317) libiberty/ChangeLog: * cplus-dem.c (ada_demangle): Initialize demangled to NULL and XDELETEVEC demangled when unknown. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241760 138bc75d-0d04-0410-961f-82ee72b054a4
2016-09-19Fix zero-length parameter bug in pex_run.ams
2016-09-19 Andrew Stubbs <ams@codesourcery.com> libiberty/ * pex-win32.c (argv_to_cmdline): Quote zero-length parameters. libiberty/testsuite/ * test-pexecute.c (main): Insert check for zero-length parameters. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240229 138bc75d-0d04-0410-961f-82ee72b054a4
2016-09-10Fix -Wshadow warning in libiberty/cp-demangle.cmark
valgrind contains a copy of the libiberty demangler which gets compiled with -Wshadow. That shows the following warning: cp-demangle.c: In function ‘d_substitution’: cp-demangle.c:3772:35: warning: declaration of ‘c’ shadows a previous local struct demangle_component *c; ^ cp-demangle.c:3708:8: note: shadowed declaration is here char c; ^ Fix that by renaming the struct demangle_component variable to dc. libiberty/ChangeLog: * cp-demangle.c (d_substitution): Change struct demangle_component variable name from c to dc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240068 138bc75d-0d04-0410-961f-82ee72b054a4
2016-08-12 PR c/7652mpolacek
gcc/ * alias.c (find_base_value): Adjust fall through comment. * cfgexpand.c (expand_debug_expr): Likewise. * combine.c (find_split_point): Likewise. (expand_compound_operation): Likewise. Add FALLTHRU. (make_compound_operation): Adjust fall through comment. (canon_reg_for_combine): Add FALLTHRU. (force_to_mode): Adjust fall through comment. (simplify_shift_const_1): Likewise. (simplify_comparison): Likewise. * config/aarch64/aarch64-builtins.c (aarch64_simd_expand_args): Add FALLTHRU. * config/aarch64/predicates.md: Likewise. * config/i386/i386.c (function_arg_advance_32): Likewise. (ix86_gimplify_va_arg): Likewise. (print_reg): Likewise. (ix86_print_operand): Likewise. (ix86_build_const_vector): Likewise. (ix86_expand_branch): Likewise. (ix86_sched_init_global): Adjust fall through comment. (ix86_expand_args_builtin): Add FALLTHRU. (ix86_expand_builtin): Likewise. (ix86_expand_vector_init_one_var): Likewise. * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. (rs6000_adjust_cost): Likewise. (insn_must_be_first_in_group): Likewise. * config/rs6000/rs6000.md: Likewise. Adjust fall through comment. * dbxout.c (dbxout_symbol): Adjust fall through comment. * df-scan.c (df_uses_record): Likewise. * dojump.c (do_jump): Add FALLTHRU. * dwarf2out.c (mem_loc_descriptor): Likewise. Adjust fall through comment. (resolve_args_picking_1): Adjust fall through comment. (loc_list_from_tree_1): Likewise. * expmed.c (make_tree): Likewise. * expr.c (expand_expr_real_2): Add FALLTHRU. (expand_expr_real_1): Likewise. Adjust fall through comment. * fold-const.c (const_binop): Adjust fall through comment. (fold_truth_not_expr): Likewise. (fold_cond_expr_with_comparison): Add FALLTHRU. (fold_binary_loc): Likewise. (contains_label_1): Adjust fall through comment. (multiple_of_p): Likewise. * gcov-tool.c (process_args): Add FALLTHRU. * genattrtab.c (check_attr_test): Likewise. (write_test_expr): Likewise. * genconfig.c (walk_insn_part): Likewise. * genpreds.c (validate_exp): Adjust fall through comment. (needs_variable): Likewise. * gensupport.c (get_alternatives_number): Add FALLTHRU. (subst_dup): Likewise. * gimple-pretty-print.c (dump_gimple_assign): Likewise. * gimplify.c (gimplify_addr_expr): Adjust fall through comment. (gimplify_scan_omp_clauses): Add FALLTHRU. (goa_stabilize_expr): Likewise. * graphite-isl-ast-to-gimple.c (substitute_ssa_name): Adjust fall through comment. * hsa-gen.c (get_address_from_value): Likewise. * ipa-icf.c (sem_function::hash_stmt): Likewise. * ira.c (ira_setup_alts): Add FALLTHRU. * lra-eliminations.c (lra_eliminate_regs_1): Adjust fall through comment. * lto-streamer-out.c (lto_output_tree_ref): Add FALLTHRU. * opts.c (common_handle_option): Likewise. * read-rtl.c (read_rtx_code): Likewise. * real.c (round_for_format): Likewise. * recog.c (asm_operand_ok): Likewise. * reginfo.c (reg_scan_mark_refs): Adjust fall through comment. * reload1.c (set_label_offsets): Likewise. (eliminate_regs_1): Likewise. (reload_reg_reaches_end_p): Likewise. * rtlanal.c (commutative_operand_precedence): Add FALLTHRU. (rtx_cost): Likewise. * sched-rgn.c (is_exception_free): Likewise. * simplify-rtx.c (simplify_rtx): Adjust fall through comment. * stor-layout.c (int_mode_for_mode): Likewise. * toplev.c (print_to_asm_out_file): Likewise. (print_to_stderr): Likewise. * tree-cfg.c (gimple_verify_flow_info): Likewise. * tree-chrec.c (chrec_fold_plus_1): Add FALLTHRU. (chrec_fold_multiply): Likewise. (evolution_function_is_invariant_rec_p): Likewise. (for_each_scev_op): Likewise. * tree-data-ref.c (siv_subscript_p): Likewise. (get_references_in_stmt): Likewise. * tree.c (find_placeholder_in_expr): Adjust fall through comment. (substitute_in_expr): Likewise. (type_cache_hasher::equal): Likewise. (walk_type_fields): Likewise. * var-tracking.c (adjust_mems): Add FALLTHRU. (set_dv_changed): Adjust fall through comment. * varasm.c (default_function_section): Add FALLTHRU. gcc/c-family/ * c-common.c (scalar_to_vector): Adjust fall through comment. * c-opts.c (c_common_handle_option): Likewise. * c-pragma.c (handle_pragma_pack): Add FALLTHRU. * c-pretty-print.c (c_pretty_printer::postfix_expression): Adjust fall through comment. * cilk.c (extract_free_variables): Add FALLTHRU. gcc/c/ * c-parser.c (c_parser_external_declaration): Add FALLTHRU. (c_parser_postfix_expression): Likewise. * c-typeck.c (build_unary_op): Adjust fall through comment. (c_mark_addressable): Likewise. gcc/cp/ * call.c (add_builtin_candidate): Add FALLTHRU. (build_integral_nontype_arg_conv): Adjust fall through comment. (build_new_op_1): Add FALLTHRU. (convert_like_real): Adjust fall through comment. * class.c (fixed_type_or_null): Likewise. * constexpr.c (cxx_eval_constant_expression): Likewise. (potential_constant_expression_1): Likewise. Add FALLTHRU. * cp-gimplify.c (cp_gimplify_expr): Adjust fall through comment. (cp_fold): Add FALLTHRU. * cvt.c (build_expr_type_conversion): Adjust fall through comment. * cxx-pretty-print.c (pp_cxx_unqualified_id): Add FALLTHRU. (pp_cxx_qualified_id): Likewise. (cxx_pretty_printer::constant): Adjust fall through comment. (cxx_pretty_printer::primary_expression): Add FALLTHRU. (pp_cxx_pm_expression): Adjust fall through comment. (cxx_pretty_printer::expression): Add FALLTHRU. (cxx_pretty_printer::declaration_specifiers): Reformat code. (pp_cxx_type_specifier_seq): Adjust fall through comment. (pp_cxx_ptr_operator): Likewise. Add FALLTHRU. * error.c (dump_type): Adjust fall through comment. (dump_decl): Likewise. * mangle.c (write_type): Likewise. * method.c (synthesized_method_walk): Add FALLTHRU. * name-lookup.c (arg_assoc_type): Likewise. * parser.c (cp_lexer_print_token): Adjust fall through comment. (cp_parser_primary_expression): Add FALLTHRU. (cp_parser_operator): Likewise. * pt.c (find_parameter_packs_r): Likewise. (tsubst_aggr_type): Adjust fall through comment. * semantics.c (finish_omp_clauses): Add FALLTHRU. * tree.c (lvalue_kind): Likewise. gcc/fortran/ * decl.c (match_attr_spec): Add FALLTHRU. * primary.c (match_arg_list_function): Likewise. * resolve.c (resolve_operator): Adjust fall through comment. (fixup_charlen): Add FALLTHRU. (resolve_allocate_expr): Adjust fall through comment. * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU. * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through comment. gcc/java/ * expr.c (java_truthvalue_conversion): Adjust fall through comment. * jcf-io.c (verify_constant_pool): Likewise. * typeck.c (promote_type): Likewise. gcc/objc/ * objc-encoding.c (encode_type): Add FALLTHRU. libcpp/ * lex.c (search_line_fast): Add FALLTHRU. (_cpp_lex_direct): Likewise. (cpp_token_val_index): Adjust fall through comment. * macro.c (parse_params): Add FALLTHRU. * pch.c (count_defs): Adjust fall through comment. (write_defs): Likewise. libiberty/ * cp-demangle.c (d_print_mod): Add FALLTHRU. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239410 138bc75d-0d04-0410-961f-82ee72b054a4
2016-08-042016-08-04 Marcel Böhme <boehme.marcel@gmail.com>law
PR c++/71696 * cplus-dem.c: Prevent infinite recursion when there is a cycle in the referencing of remembered mangled types. (work_stuff): New stack to keep track of the remembered mangled types that are currently being processed. (push_processed_type): New method to push currently processed remembered type onto the stack. (pop_processed_type): New method to pop currently processed remembered type from the stack. (work_stuff_copy_to_from): Copy values of new variables. (delete_non_B_K_work_stuff): Free stack memory. (demangle_args): Push/Pop currently processed remembered type. (do_type): Do not demangle a cyclic reference and push/pop referenced remembered type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239143 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-29include/aldyh
* libiberty.h (MAX_ALLOCA_SIZE): New macro. libiberty/ * make-relative-prefix.c (make_relative_prefix_1): Fall back to malloc if alloca argument is greater than MAX_ALLOCA_SIZE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238880 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-18 Demangle C++17 fold-expressions.jason
* cp-demangle.c (cplus_demangle_operators): Add f[lrLR]. (d_expression_1): Handle them. (d_maybe_print_fold_expression): New. (d_print_comp_inner): Use it. (d_index_template_argument): Handle negative index. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238437 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-15 PR c++/71814 - mangling sizeof... (sP and sZ)jason
gcc/cp/ * mangle.c (write_expression): Handle sizeof... an argument pack. libiberty/ * cp-demangle.c (cplus_demangle_operators): Add sP and sZ. (d_print_comp_inner): Handle them. (d_template_args_1): Split out from d_template_args. (d_args_length): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238389 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-13 PR c++/70926law
* cplus-dem.c: Handle large values and overflow when demangling length variables. (demangle_template_value_parm): Read only until end of mangled string. (do_hpacc_template_literal): Likewise. (do_type): Handle overflow when demangling array indices. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238313 138bc75d-0d04-0410-961f-82ee72b054a4
2016-07-112016-06-12 Brooks Moses <bmoses@google.com>brooks
* cp-demangle.c (cplus_demangle_print_callback): Avoid zero-length VLAs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238233 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-31Don't needlessly clear xmemdup allocated memory.amodra
* xmemdup.c (xmemdup): Use xmalloc rather than xcalloc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236917 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-19Move ChangeLog entry to the right file.jakub
PR other/61321 PR other/61233 * demangle.h (enum demangle_component_type) <DEMANGLE_COMPONENT_CONVERSION>: New value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236449 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-19Remove libiberty/ path prefixes.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236448 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-19 PR c++/70498jakub
* cp-demangle.c (d_expression_1): Formatting fix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236445 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-19Fix up 2 ChangeLog entries.jakub
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236443 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-18 * cplus-dem.c (enum type_kind_t): Add tk_rvalue_referencelaw
constant. (demangle_template_value_parm): Handle tk_rvalue_reference type kind. (do_type): Support 'O' type id (rvalue references). * testsuite/demangle-expected: Add tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236434 138bc75d-0d04-0410-961f-82ee72b054a4
2016-05-02Demangler integer overflow fixes from Marcel Böhme.bernds
PR c++/70498 * cp-demangle.c: Parse numbers as integer instead of long to avoid overflow after sanity checks. Include <limits.h> if available. (INT_MAX): Define if necessary. (d_make_template_param): Takes integer argument instead of long. (d_make_function_param): Likewise. (d_append_num): Likewise. (d_identifier): Likewise. (d_number): Parse as and return integer. (d_compact_number): Handle overflow. (d_source_name): Change variable type to integer for parsed number. (d_java_resource): Likewise. (d_special_name): Likewise. (d_discriminator): Likewise. (d_unnamed_type): Likewise. * testsuite/demangle-expected: Add regression test cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235767 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-30/olegendo
* config.guess: Remove SH5 support. * config.sub: Likewise. * configure: Likewise. * configure.ac: Likewise. config/ * picflag.m4: Remove SH5 support. gcc/ * config/sh/t-sh: Remove SH5 support. * config.gcc: Likewise. * configure: Likewise. contrib/ * compare-all-tests: Remove SH5 support. * config-list.mk: Likewise. libada/ * configure: Remove SH5 support. libgcc/ * config.host: Remove SH5 support. * configure: Likewise. libiberty/ * configure: Remove SH5 support. libjava/ * classpath/config.guess: Remove SH5 support. * classpath/config.sub: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235676 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-08Fix PR number in ChangeLogbernds
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234830 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-08Fix memory allocation size overflows (PR69687, patch by Marcel Böhme)bernds
PR c++/69687 * cplus-dem.c: Include <limits.h> if available. (INT_MAX): Define if necessary. (remember_type, remember_Ktype, register_Btype, string_need): Abort if we detect cases where we the size of the allocation would overflow. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234829 138bc75d-0d04-0410-961f-82ee72b054a4
2016-04-08Handle an overflow case (PR70498, patch by Marcel Böhme).bernds
PR c++/70498 * cplus-dem.c (gnu_special): Handle case where consume_count returns -1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234828 138bc75d-0d04-0410-961f-82ee72b054a4
2016-03-31Add BZ markers to last commitlaw
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234646 138bc75d-0d04-0410-961f-82ee72b054a4
2016-03-31 * cplus-dem.c (squangle_mop_up): Zero bsize/ksize after freeinglaw
btypevec/ktypevec. * testsuite/demangle-expected: Add coverage tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234645 138bc75d-0d04-0410-961f-82ee72b054a4
2016-01-27libiberty/ChangeLog:ibuclaw
2016-01-26 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_call_convention): Handle extern Objective-C function calling convention. (dlang_call_convention_p): Likewise. (dlang_type): Likewise. * testsuite/d-demangle-expected: Add coverage tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232864 138bc75d-0d04-0410-961f-82ee72b054a4
2016-01-27libiberty/ChangeLog:ibuclaw
2016-01-26 Iain Buclaw <ibuclaw@gdcproject.org> * d-demangle.c (dlang_function_args): Append ',' for variadic functions only if parameters were seen before the elipsis symbol. * testsuite/d-demangle-expected: Add coverage test for parameter-less variadic functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232863 138bc75d-0d04-0410-961f-82ee72b054a4