Skip to content
Snippets Groups Projects
  1. Jan 02, 2025
  2. Dec 24, 2024
  3. Dec 23, 2024
    • Simon Martin's avatar
      libcc1: Fix tags generation target · 6c59463a
      Simon Martin authored
      'make tags' currently fails for libcc1 with this:
       *** No rule to make target `marshall-c.hh', needed by `tags-am'.  Stop.
      
      The problem is that while marshall-c.hh has been removed via
      r12-454-g25d1a6ecdc443f, it's still part of the libcc1_la_SOURCES
      variable, hence the 'tags' target has a dependency on it.
      
      This patch simply removes the marshall_c_source variable, that should be
      empty.
      
      libcc1/ChangeLog:
      
      	* Makefile.am: Remove reference to deleted marshall-c.h.
      	* Makefile.in: Regenerate.
      6c59463a
  4. Dec 21, 2024
  5. Dec 20, 2024
    • Nathaniel Shead's avatar
      c++/modules: Check linkage for exported declarations · fde64d11
      Nathaniel Shead authored
      
      By [module.interface] p3, if an exported declaration is not within a
      header unit, it shall not declare a name with internal linkage.
      
      Unfortunately we cannot just do this within set_originating_module,
      since at the locations its called the linkage for declarations are not
      always fully determined yet.  We could move the calls but this causes
      the checking assertion to fail as the originating module declaration may
      have moved, and in general for some kinds of declarations it's not
      always obvious where it should be moved to.
      
      This patch instead introduces a new function to check that the linkage
      of a declaration within a module is correct, to be called for all
      declarations once their linkage is fully determined.
      
      As a drive-by fix this patch also improves the source location of
      namespace aliases to point at the identifier rather than the terminating
      semicolon.
      
      gcc/cp/ChangeLog:
      
      	* cp-tree.h (check_module_decl_linkage): Declare.
      	* decl2.cc (finish_static_data_member_decl): Check linkage.
      	* module.cc (set_originating_module): Adjust comment.
      	(check_module_decl_linkage): New function.
      	* name-lookup.cc (do_namespace_alias): Build alias with
      	specified location, check linkage.
      	(pushtag): Check linkage.
      	(push_namespace): Slightly clarify error message.
      	* name-lookup.h (do_namespace_alias): Add location parameter.
      	* parser.cc (cp_parser_namespace_alias_definition): Pass
      	identifier location to do_namespace_alias.
      	(cp_parser_alias_declaration): Check linkage.
      	(cp_parser_init_declarator): Check linkage.
      	(cp_parser_function_definition_after_declarator): Check linkage.
      	(cp_parser_save_member_function_body): Check linkage.
      	* pt.cc (finish_concept_definition): Mark as public, check
      	linkage.
      
      libcc1/ChangeLog:
      
      	* libcp1plugin.cc (plugin_add_namespace_alias): Call
      	do_namespace_alias with input_location.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/modules/export-3.C: Adjust error message.
      	* g++.dg/modules/export-6.C: New test.
      
      Signed-off-by: default avatarNathaniel Shead <nathanieloshead@gmail.com>
      Reviewed-by: default avatarJason Merrill <jason@redhat.com>
      fde64d11
  6. Sep 21, 2024
  7. Sep 20, 2024
    • David Malcolm's avatar
      diagnostics: convert text hooks to use diagnostic_text_output_format [PR116613] · 7da682c8
      David Malcolm authored
      
      The diagnostic_starter and diagnostic_finalizer callbacks and most of
      their support subroutines are only used by the "text" output format.
      
      Emphasize this and reduce the binding with diagnostic_context
      by renaming the callbacks to add "_text" in their names, and converting
      the first param from diagnostic_context * to
      diagnostic_text_output_output &.  Update the various subroutines used
      by diagnostic starter/finalizer callbacks to also take a
      diagnostic_text_output_output & rather than a diagnostic_context *.
      Move m_includes and m_last_seen from the context to the text output.
      
      Use the text_output's get_printer () rather than the context's
      m_printer, which should ease the transition to multiple output sinks.
      
      No functional change intended.
      
      gcc/c-family/ChangeLog:
      	PR other/116613
      	* c-opts.cc: Include "diagnostic-format-text.h".
      	(c_diagnostic_finalizer): Rename to...
      	(c_diagnostic_text_finalizer): ...this.  Convert first param
      	from diagnostic_context * to diagnostic_text_output_format & and
      	update accordingly.
      	(c_common_diagnostics_set_defaults): Update for renamings.
      
      gcc/ChangeLog:
      	PR other/116613
      	* coretypes.h (class diagnostic_text_output_format): Add forward
      	decl.
      	* diagnostic-format-json.cc
      	(json_output_format::after_diagnostic): New.
      	* diagnostic-format-sarif.cc
      	(sarif_output_format::after_diagnostic): New.
      	* diagnostic-format-text.cc: Use pragmas to ignore -Wformat-diag.
      	(diagnostic_text_output_format::~diagnostic_text_output_format):
      	Use get_printer.  Clean up m_includes_seen here, rather than
      	in ~diagnostic_context.
      	(diagnostic_text_output_format::on_report_diagnostic):  Use
      	get_printer.  Update for callback renamings and pass *this
      	to them, rather than &m_context.
      	(diagnostic_text_output_format::after_diagnostic): New.
      	(diagnostic_text_output_format::includes_seen_p): Move here
      	from diagnostic_context/diagnostic.cc.
      	(diagnostic_text_output_format::get_location_text): New.
      	(maybe_line_and_column): Move here from diagnostic.cc and make
      	non-static.
      	(diagnostic_text_output_format::report_current_module): Move
      	here from diagnostic_context/diagnostic.cc.
      	(default_diagnostic_text_starter): Move here from diagnostic.cc,
      	renaming from default_diagnostic_starter.
      	(default_diagnostic_text_finalizer): Likewise, renaming from
      	default_diagnostic_finalizer.
      	* diagnostic-format-text.h
      	(diagnostic_text_output_format::diagnostic_text_output_format):
      	Initialize m_last_module and m_includes_seen.
      	(diagnostic_text_output_format::after_diagnostic): New decl.
      	(diagnostic_text_output_format::build_prefix): New decl.
      	(diagnostic_text_output_format::report_current_module): New decl.
      	(diagnostic_text_output_format::append_note): New decl.
      	(diagnostic_text_output_format::file_name_as_prefix): New decl.
      	(diagnostic_text_output_format::print_path): New decl.
      	(diagnostic_text_output_format::show_column_p): New decl.
      	(diagnostic_text_output_format::get_location_text): New decl.
      	(diagnostic_text_output_format::includes_seen_p): New decl.
      	(diagnostic_text_output_format::show_any_path): New decl.
      	(diagnostic_text_output_format::m_last_module): New field.
      	(diagnostic_text_output_format::m_includes_seen): New field.
      	* diagnostic-format.h
      	(diagnostic_output_format::after_diagnostic): New vfunc.
      	(diagnostic_output_format::get_context): New.
      	(diagnostic_output_format::get_diagram_theme): New.
      	* diagnostic-macro-unwinding.cc: Include
      	"diagnostic-format-text.h".
      	(maybe_unwind_expanded_macro_loc): Convert first param from
      	diagnostic_context * to diagnostic_text_output_format & and update
      	accordingly.
      	(virt_loc_aware_diagnostic_finalizer): Likewise.
      	* diagnostic-macro-unwinding.h
      	(virt_loc_aware_diagnostic_finalizer): Likewise.
      	(maybe_unwind_expanded_macro_loc): Likewise.
      	* diagnostic-path.cc: Include "diagnostic-format-text.h".
      	(path_label::path_label): Drop "ctxt" param and add "colorize"
      	and "allow_emojis" params.  Update initializations.
      	(path_label::get_text): Use m_colorize rather than querying
      	m_ctxt.m_printer.  Use m_allow_emojis rather than querying
      	m_ctxt's diagram theme.
      	(path_label::m_ctxt): Drop field.
      	(path_label::m_colorize): Drop field.
      	(path_label::m_allow_emojis): Drop field.
      	(event_range::event_range): Drop param "ctxt".  Add params
      	"colorize_labels" and "allow_emojis".
      	(event_range::print): Convert first param from
      	diagnostic_context & to diagnostic_text_output_format & and update
      	accordingly.
      	(path_summary::path_summary): Likewise.
      	(path_summary::print_swimlane_for_event_range): Likewise.
      	(print_path_summary_as_text): Likewise for 3rd param.
      	(diagnostic_context::print_path): Convert to...
      	(diagnostic_text_output_format::print_path): ...this.
      	(selftest::test_empty_path): Update to use a
      	diagnostic_text_output_format.
      	(selftest::test_intraprocedural_path): Likewise.
      	(selftest::test_interprocedural_path_1): Likewise.
      	(selftest::test_interprocedural_path_2): Likewise.
      	(selftest::test_recursion): Likewise.
      	(selftest::test_control_flow_1): Likewise.
      	(selftest::test_control_flow_2): Likewise.
      	(selftest::test_control_flow_3): Likewise.
      	(selftest::assert_cfg_edge_path_streq): Likewise.
      	(selftest::test_control_flow_5): Likewise.
      	(selftest::test_control_flow_6): Likewise.
      	* diagnostic.cc (file_name_as_prefix): Convert to...
      	(diagnostic_text_output_format::file_name_as_prefix): ...this.
      	(diagnostic_context::initialize): Update for renamings.
      	Move m_last_module and m_includes_seen into text output.
      	(diagnostic_context::finish): Likewise.
      	(diagnostic_context::get_location_text): Add "colorize" param.
      	(diagnostic_build_prefix): Convert to...
      	(diagnostic_text_output_format::build_prefix): ...this.
      	(diagnostic_context::includes_seen_p): Move from here to
      	diagnostic_text_output_format/diagnostic-format-text.cc.
      	(diagnostic_context::report_current_module): Likewise.
      	(diagnostic_context::show_any_path): Convert to...
      	(diagnostic_text_output_format::show_any_path): ...this.
      	(default_diagnostic_starter): Rename and move to
      	diagnostic-format-text.cc.
      	(default_diagnostic_start_span_fn): Pass colorize bool
      	to get_location_text.
      	(default_diagnostic_finalizer): Rename and move to
      	diagnostic-format-text.cc.
      	(diagnostic_context::report_diagnostic): Replace call to
      	show_any_path with call to new output format "after_diagnostic"
      	vfunc, moving show_any_path call to the text output format.
      	(diagnostic_append_note): Convert to...
      	(diagnostic_text_output_format::append_note): ...this.
      	(selftest::assert_location_text): Pass in false for colorization.
      	* diagnostic.h (diagnostic_starter_fn): Rename to...
      	(diagnostic_text_starter_fn): ...this.  Convert first param from
      	diagnostic_context * to diagnostic_text_output_format &.
      	(diagnostic_finalizer_fn, diagnostic_text_finalizer_fn): Likewise.
      	(diagnostic_context): Update friends for renamings.
      	(diagnostic_context::report_current_module): Move to text output
      	format.
      	(diagnostic_context::get_location_text): Add "colorize" bool.
      	(diagnostic_context::includes_seen_p): Move to text output format.
      	(diagnostic_context::show_any_path): Likewise.
      	(diagnostic_context::print_path): Likewise.
      	(diagnostic_context::m_text_callbacks): Update for renamings.
      	(diagnostic_context::m_last_module): Move to text output format.
      	(diagnostic_context::m_includes_seen): Likewise.
      	(diagnostic_starter): Rename to...
      	(diagnostic_text_starter): ...this and update return type.
      	(diagnostic_finalizer): Rename to...
      	(diagnostic_text_finalizer): ...this and update return type.
      	(diagnostic_report_current_module): Drop decl in favor of a member
      	function of diagnostic_text_output_format.
      	(diagnostic_append_note): Likewise.
      	(default_diagnostic_starter): Rename to...
      	(default_diagnostic_text_starter): ...this, updating type.
      	(default_diagnostic_finalizer): Rename to...
      	(default_diagnostic_text_finalizer): ...this, updating type.
      	(file_name_as_prefix): Drop decl.
      	* langhooks-def.h (lhd_print_error_function): Convert first param
      	from diagnostic_context * to diagnostic_text_output_format &.
      	* langhooks.cc: Include "diagnostic-format-text.h".
      	(lhd_print_error_function): Likewise.  Update accordingly
      	* langhooks.h (lang_hooks::print_error_function): Convert first
      	param from diagnostic_context * to
      	diagnostic_text_output_format &.
      	* tree-diagnostic.cc: Include "diagnostic-format-text.h".
      	(diagnostic_report_current_function): Convert first param from
      	diagnostic_context * to diagnostic_text_output_format & and update
      	accordingly.
      	(default_tree_diagnostic_starter): Rename to...
      	(default_tree_diagnostic_text_starter): ...this.  Convert first
      	param from diagnostic_context * to diagnostic_text_output_format &
      	and update accordingly.
      	(tree_diagnostics_defaults): Update for renamings.
      
      gcc/cp/ChangeLog:
      	PR other/116613
      	* cp-tree.h (cxx_print_error_function): Convert first param
      	from diagnostic_context * to diagnostic_text_output_format &.
      	* error.cc: Include "diagnostic-format-text.h".
      	(cxx_initialize_diagnostics): Update for renamings.
      	(cxx_print_error_function): Convert first param from
      	diagnostic_context * to diagnostic_text_output_format & and update
      	accordingly
      	(cp_diagnostic_starter): Rename to...
      	(cp_diagnostic_text_starter): ...this.  Convert first
      	param from diagnostic_context * to diagnostic_text_output_format &
      	and update accordingly.
      	(cp_print_error_function): Likewise.
      	(print_instantiation_full_context): Likewise.
      	(print_instantiation_partial_context_line): Likewise.
      	(print_instantiation_partial_context): Likewise.
      	(maybe_print_instantiation_context): Likewise.
      	(maybe_print_constexpr_context): Likewise.
      	(print_location): Likewise.
      	(print_constrained_decl_info): Likewise.
      	(print_concept_check_info): Likewise.
      	(print_constraint_context_head): Likewise.
      	(print_requires_expression_info): Likewise.
      	(maybe_print_single_constraint_context): Likewise.
      
      gcc/fortran/ChangeLog:
      	PR other/116613
      	* error.cc: Include "diagnostic-format-text.h".
      	(gfc_diagnostic_starter): Rename to...
      	(gfc_diagnostic_text_starter): ...this.  Convert first
      	param from diagnostic_context * to diagnostic_text_output_format &
      	and update accordingly.
      	(gfc_diagnostic_finalizer, gfc_diagnostic_text_finalizer):
      	Likewise.
      	(gfc_diagnostics_init): Update for renamings.
      	(gfc_diagnostics_finish): Likewise.
      
      gcc/jit/ChangeLog:
      	PR other/116613
      	* dummy-frontend.cc: Include "diagnostic-format-text.h".
      	(jit_begin_diagnostic): Convert first param from
      	diagnostic_context * to diagnostic_text_output_format &
      	(jit_end_diagnostic): Likewise.  Update accordingly.
      	(jit_langhook_init): Update for renamings.
      
      gcc/rust/ChangeLog:
      	PR other/116613
      	* resolve/rust-ast-resolve-expr.cc
      	(funny_ice_finalizer): : Convert first param from
      	diagnostic_context * to diagnostic_text_output_format &.
      	(ResolveExpr::visit): Update for renaming.
      
      gcc/testsuite/ChangeLog:
      	PR other/116613
      	* g++.dg/plugin/show_template_tree_color_plugin.c
      	(noop_starter_fn): Rename to...
      	(noop_text_starter_fn): ...this.  Update first param from dc to
      	text_output.
      	(plugin_init): Update for renamings.
      	* gcc.dg/plugin/diagnostic_group_plugin.c
      	(test_diagnostic_starter): Rename to...
      	(test_diagnostic_text_starter): ...this.  Update first param from
      	dc to text_output.
      	(plugin_init): Update for renaming.
      	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c: Include
      	"diagnostic-format-text.h".
      	(custom_diagnostic_finalizer): Rename to...
      	(custom_diagnostic_text_finalizer): ...this.  Update first param
      	from dc to text_output.
      	(test_show_locus): Update for renamings.
      	* gcc.dg/plugin/location_overflow_plugin.c: Include
      	"diagnostic-format-text.h".
      	(original_finalizer): Rename to...
      	(original_text_finalizer): ...this and update type.
      	(verify_unpacked_ranges): Update first param from dc to
      	text_output.  Update for this and for renamings.
      	(verify_no_columns): Likewise.
      	(plugin_init): Update for renamings.
      
      libcc1/ChangeLog:
      	PR other/116613
      	* context.cc: Include "diagnostic-format-text.h".
      	(plugin_print_error_function): Update first param from
      	diagnostic_context * to diagnostic_text_output_format &.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      7da682c8
  8. Mar 17, 2024
  9. Mar 16, 2024
  10. Mar 01, 2024
  11. Feb 29, 2024
    • Tom Tromey's avatar
      Fix PR libcc1/113977 · bc0e18a9
      Tom Tromey authored
      PR libcc1/113977 points out a case where a simple expression is
      rejected with a compiler error message.  The bug here is that gdb does
      not inform the plugin of the correct alignment -- in fact, there is no
      way to do that.
      
      This patch adds a new method to allow the alignment to be set, and
      bumps the C front end protocol version.
      
      It also includes some updates to various comments in 'include', done
      here to simplify the merge to binutils-gdb.
      
      include
      
      	* gcc-cp-interface.h (gcc_cp_fe_context_function): Update
      	comment.
      	* gcc-c-interface.h (enum gcc_c_api_version) <GCC_C_FE_VERSION_2>:
      	New constant.
      	(gcc_c_fe_context_function): Update comment.
      	* gcc-c-fe.def (finish_record_with_alignment): New method.
      	Update documentation.
      
      libcc1
      
      	PR libcc1/113977
      	* libcc1plugin.cc (plugin_finish_record_or_union): New function.
      	(plugin_finish_record_or_union): Rewrite.
      	(plugin_init): Use GCC_C_FE_VERSION_2.
      	* libcc1.cc (c_vtable): Use GCC_C_FE_VERSION_2.
      	(gcc_c_fe_context): Check for GCC_C_FE_VERSION_2.
      
      
      bc0e18a9
    • Tom Tromey's avatar
      Fix version negotiation in libcc1 plugins · 54137725
      Tom Tromey authored
      This fixes version negotiation in the libcc1 plugins.  It's done in a
      simple way: the version number from the context object is now passed
      to base_gdb_plugin.
      
      The idea behind this is that when the client (gdb) requests version N,
      the plugin should respond with the newest version that it knows of
      that is backward compatible to N.  That is, the connection can be
      upgraded.  Note that the protocol does not change much, and no
      backward incompatibilities have ever been needed.
      
      The C plugin is also changed to advertise GCC_C_FE_VERSION_1.
      
      The version negotiation approach should of course be documented, but I
      did that in a subsequent patch, in order to only have one patch
      touching the 'include' directory and thus needing a merge to
      binutils-gdb.
      
      libcc1
      
      	* libcp1.cc (libcp1::libcp1): Use FE version number from context.
      	* libcc1.cc (libcc1::libcc1): Use FE version number from context.
      	(c_vtable): Use GCC_C_FE_VERSION_1.
      
      
      54137725
    • Tom Tromey's avatar
      Change 'v1' float and int code to fall back to v0 · fd846abc
      Tom Tromey authored
      While working on another patch, I discovered that the libcc1 plugin
      code never did version negotiation correctly.  So, the patches to
      introduce v1 never did anything -- the new code, as far as I know, has
      never been run.
      
      Making version negotiation work shows that the existing code causes
      crashes.  For example, safe_lookup_builtin_type might return
      error_mark_node in some cases, which the callers aren't prepared to
      accept.
      
      Looking into it some more, I couldn't find any justification for this
      v1 code for the C compiler plugin.  Since it's not run at all, it's
      also clear that removing it doesn't cause any regressions in gdb.
      
      However, rather than remove it, this patch changes it to handle
      ERROR_MARK better, and then to fall back to the v0 code if the new
      code fails to find the type it's looking for.
      
      libcc1
      
      	* libcc1plugin.cc (safe_lookup_builtin_type): Handle ERROR_MARK.
      	(plugin_int_type): Fall back to plugin_int_type_v0.
      	(plugin_float_type): Fall back to plugin_float_type_v0.
      
      
      fd846abc
  12. Feb 10, 2024
  13. Feb 09, 2024
    • Marek Polacek's avatar
      c++: make build_throw SFINAE-friendly [PR98388] · 3a3e0f1b
      Marek Polacek authored
      Here the problem is that we give hard errors while substituting
      template parameters during overload resolution of is_throwable
      which has an invalid throw in decltype.
      
      The backtrace shows that fn_type_unification -> instantiate_template
      -> tsubst* passes complain=0 as expected, but build_throw doesn't
      have a complain parameter.  So let's add one.  Also remove a redundant
      local variable which I should have removed in my P2266 patch.
      
      There's still one problem for which I opened <https://gcc.gnu.org/PR113853>.
      We need to patch up treat_lvalue_as_rvalue_p and remove the dg-bogus.
      
      Thanks to Patrick for notifying me of this PR.  This doesn't fully fix
      113789; there I think I'll have to figure our why a candidate wasn't
      discarded from the overload set.
      
      	PR c++/98388
      
      gcc/cp/ChangeLog:
      
      	* coroutines.cc (coro_rewrite_function_body): Pass tf_warning_or_error
      	to build_throw.
      	(morph_fn_to_coro): Likewise.
      	* cp-tree.h (build_throw): Adjust.
      	* except.cc (expand_end_catch_block): Pass tf_warning_or_error to
      	build_throw.
      	(build_throw): Add a tsubst_flags_t parameter.  Use it.  Remove
      	redundant variable.  Guard an inform call.
      	* parser.cc (cp_parser_throw_expression): Pass tf_warning_or_error
      	to build_throw.
      	* pt.cc (tsubst_expr) <case THROW_EXPR>: Pass complain to build_throw.
      
      libcc1/ChangeLog:
      
      	* libcp1plugin.cc (plugin_build_unary_expr): Pass tf_error to
      	build_throw.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp0x/sfinae69.C: New test.
      3a3e0f1b
  14. Jan 10, 2024
  15. Jan 09, 2024
    • waffl3x's avatar
      c++: P0847R7 (deducing this) - prerequisite changes. [PR102609] · f9fbf93d
      waffl3x authored
      
      Adds the xobj_flag member to lang_decl_fn and a corresponding member access
      macro and predicate to support the addition of explicit object member
      functions. Additionally, since explicit object member functions are also
      non-static member functions, we need to change uses of
      DECL_NONSTATIC_MEMBER_FUNCTION_P to clarify whether they intend to include
      or exclude them.
      
      	PR c++/102609
      
      gcc/cp/ChangeLog:
      
      	* cp-tree.h (struct lang_decl_fn): New data member.
      	(DECL_NONSTATIC_MEMBER_FUNCTION_P): Poison.
      	(DECL_IOBJ_MEMBER_FUNCTION_P): Define.
      	(DECL_FUNCTION_XOBJ_FLAG): Define.
      	(DECL_XOBJ_MEMBER_FUNCTION_P): Define.
      	(DECL_OBJECT_MEMBER_FUNCTION_P): Define.
      	(DECL_FUNCTION_MEMBER_P): Don't use
      	DECL_NONSTATIC_MEMBER_FUNCTION_P.
      	(DECL_CONST_MEMFUNC_P): Likewise.
      	(DECL_VOLATILE_MEMFUNC_P): Likewise.
      	(DECL_NONSTATIC_MEMBER_P): Likewise.
      	* module.cc (trees_out::lang_decl_bools): Handle xobj_flag.
      	(trees_in::lang_decl_bools): Handle xobj_flag.
      	* call.cc (build_this_conversion)
      	(add_function_candidate)
      	(add_template_candidate_real)
      	(add_candidates)
      	(maybe_warn_class_memaccess)
      	(cand_parms_match)
      	(joust)
      	(do_warn_dangling_reference)
      	* class.cc (finalize_literal_type_property)
      	(finish_struct)
      	(resolve_address_of_overloaded_function)
      	* constexpr.cc (is_valid_constexpr_fn)
      	(cxx_bind_parameters_in_call)
      	* contracts.cc (build_contract_condition_function)
      	* cp-objcp-common.cc (cp_decl_dwarf_attribute)
      	* cxx-pretty-print.cc (cxx_pretty_printer::postfix_expression)
      	(cxx_pretty_printer::declaration_specifiers)
      	(cxx_pretty_printer::direct_declarator)
      	* decl.cc (cp_finish_decl)
      	(grok_special_member_properties)
      	(start_preparsed_function)
      	(record_key_method_defined)
      	* decl2.cc (cp_handle_deprecated_or_unavailable)
      	* init.cc (find_uninit_fields_r)
      	(build_offset_ref)
      	* lambda.cc (lambda_expr_this_capture)
      	(maybe_generic_this_capture)
      	(nonlambda_method_basetype)
      	* mangle.cc (write_nested_name)
      	* method.cc (early_check_defaulted_comparison)
      	(skip_artificial_parms_for)
      	(num_artificial_parms_for)
      	* pt.cc (is_specialization_of_friend)
      	(determine_specialization)
      	(copy_default_args_to_explicit_spec)
      	(check_explicit_specialization)
      	(tsubst_contract_attribute)
      	(check_non_deducible_conversions)
      	(more_specialized_fn)
      	(maybe_instantiate_noexcept)
      	(register_parameter_specializations)
      	(value_dependent_expression_p)
      	* search.cc (shared_member_p)
      	(lookup_member)
      	(field_access_p)
      	* semantics.cc (finish_omp_declare_simd_methods)
      	* tree.cc (lvalue_kind)
      	* typeck.cc (invalid_nonstatic_memfn_p): Don't use
      	DECL_NONSTATIC_MEMBER_FUNCTION_P.
      
      libcc1/ChangeLog:
      
      	* libcp1plugin.cc (plugin_pragma_push_user_expression): Don't use
      	DECL_NONSTATIC_MEMBER_FUNCTION_P.
      
      Signed-off-by: default avatarWaffl3x <waffl3x@protonmail.com>
      Co-authored-by: default avatarJason Merrill <jason@redhat.com>
      f9fbf93d
  16. Jan 03, 2024
  17. Dec 07, 2023
  18. Dec 06, 2023
    • David Malcolm's avatar
      diagnostics: use const and references for diagnostic_info · 8fc4e6c3
      David Malcolm authored
      
      No functional change intended.
      
      gcc/c-family/ChangeLog:
      	* c-opts.cc (c_diagnostic_finalizer): Make "diagnostic" param
      	const.
      
      gcc/cp/ChangeLog:
      	* cp-tree.h (cxx_print_error_function): Make diagnostic_info param
      	const.
      	* error.cc (cxx_print_error_function): Likewise.
      	(cp_diagnostic_starter): Likewise.
      	(cp_print_error_function): Likewise.
      
      gcc/ChangeLog:
      	* diagnostic-format-json.cc (on_begin_diagnostic): Convert param
      	to const reference.
      	(on_end_diagnostic): Likewise.
      	(json_output_format::on_end_diagnostic): Likewise.
      	* diagnostic-format-sarif.cc
      	(sarif_invocation::add_notification_for_ice): Likewise.
      	(sarif_result::on_nested_diagnostic): Likewise.
      	(sarif_ice_notification::sarif_ice_notification): Likewise.
      	(sarif_builder::end_diagnostic): Likewise.
      	(sarif_builder::make_result_object): Likewise.
      	(make_reporting_descriptor_object_for_warning): Likewise.
      	(sarif_builder::make_locations_arr): Likewise.
      	(sarif_output_format::on_begin_diagnostic): Likewise.
      	(sarif_output_format::on_end_diagnostic): Likewise.
      	* diagnostic.cc (default_diagnostic_starter): Make diagnostic_info
      	param const.
      	(default_diagnostic_finalizer): Likewise.
      	(diagnostic_context::report_diagnostic): Pass diagnostic by
      	reference to on_{begin,end}_diagnostic.
      	(diagnostic_text_output_format::on_begin_diagnostic): Convert
      	param to const reference.
      	(diagnostic_text_output_format::on_end_diagnostic): Likewise.
      	* diagnostic.h (diagnostic_starter_fn): Make diagnostic_info param
      	const.
      	(diagnostic_finalizer_fn): Likeewise.
      	(diagnostic_output_format::on_begin_diagnostic): Convert param to
      	const reference.
      	(diagnostic_output_format::on_end_diagnostic): Likewise.
      	(diagnostic_text_output_format::on_begin_diagnostic): Likewise.
      	(diagnostic_text_output_format::on_end_diagnostic): Likewise.
      	(default_diagnostic_starter): Make diagnostic_info param const.
      	(default_diagnostic_finalizer): Likewise.
      	* langhooks-def.h (lhd_print_error_function): Make diagnostic_info
      	param const.
      	* langhooks.cc (lhd_print_error_function): Likewise.
      	* langhooks.h (lang_hooks::print_error_function): Likewise.
      	* tree-diagnostic.cc (diagnostic_report_current_function):
      	Likewise.
      	(default_tree_diagnostic_starter): Likewise.
      	(virt_loc_aware_diagnostic_finalizer): Likewise.
      	* tree-diagnostic.h (diagnostic_report_current_function):
      	Likewise.
      	(virt_loc_aware_diagnostic_finalizer): Likewise.
      
      gcc/fortran/ChangeLog:
      	* error.cc (gfc_diagnostic_starter): Make diagnostic_info param
      	const.
      	(gfc_diagnostic_finalizer): Likewise.
      
      gcc/jit/ChangeLog:
      	* dummy-frontend.cc (jit_begin_diagnostic): Make diagnostic_info
      	param const.
      	(jit_end_diagnostic): Likewise.  Pass to add_diagnostic by
      	reference.
      	* jit-playback.cc (jit::playback::context::add_diagnostic):
      	Convert diagnostic_info to const reference.
      	* jit-playback.h (jit::playback::context::add_diagnostic):
      	Likewise.
      
      gcc/testsuite/ChangeLog:
      	* g++.dg/plugin/show_template_tree_color_plugin.c
      	(noop_starter_fn): Make diagnostic_info param const.
      	* gcc.dg/plugin/diagnostic_group_plugin.c
      	(test_diagnostic_starter): Likewise.
      	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
      	(custom_diagnostic_finalizer): Likewise.
      	* gcc.dg/plugin/location_overflow_plugin.c
      	(verify_unpacked_ranges): Likewise.
      	(verify_no_columns): Likewise.
      
      libcc1/ChangeLog:
      	* context.cc (plugin_print_error_function): Make diagnostic_info
      	param const.
      
      Signed-off-by: default avatarDavid Malcolm <dmalcolm@redhat.com>
      8fc4e6c3
  19. Nov 17, 2023
  20. Nov 16, 2023
    • Tom Tromey's avatar
      Fix crash in libcc1 · 6d16e460
      Tom Tromey authored
      The gdb tests of the libcc1 plugin have been failing lately.  I
      tracked this down to a crash trying to access an enum's underlying
      type.  This patch fixes the crash by setting this type.
      
      
      	* libcc1plugin.cc (plugin_build_enum_type): Set
      	ENUM_UNDERLYING_TYPE.
      6d16e460
  21. Oct 23, 2023
  22. Oct 22, 2023
    • Iain Sandoe's avatar
      Config,Darwin: Allow for configuring Darwin to use embedded runpath. · 6a6d3817
      Iain Sandoe authored
      Recent Darwin versions place contraints on the use of run paths
      specified in environment variables.  This breaks some assumptions
      in the GCC build.
      
      This change allows the user to configure a Darwin build to use
      '@rpath/libraryname.dylib' in library names and then to add an
      embedded runpath to executables (and libraries with dependents).
      
      The embedded runpath is added by default unless the user adds
      '-nodefaultrpaths' to the link line.
      
      For an installed compiler, it means that any executable built with
      that compiler will reference the runtimes installed with the
      compiler (equivalent to hard-coding the library path into the name
      of the library).
      
      During build-time configurations  any "-B" entries will be added to
      the runpath thus the newly-built libraries will be found by exes.
      
      Since the install name is set in libtool, that decision needs to be
      available here (but might also cause dependent ones in Makefiles,
      so we need to export a conditional).
      
      This facility is not available for Darwin 8 or earlier, however the
      existing environment variable runpath does work there.
      
      We default this on for systems where the external DYLD_LIBRARY_PATH
      does not work and off for Darwin 8 or earlier.  For systems that can
      use either method, if the value is unset, we use the default (which
      is currently DYLD_LIBRARY_PATH).
      
      ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Do not add default runpaths to GCC exes
      	when we are building -static-libstdc++/-static-libgcc (the
      	default).
      	* libtool.m4: Add 'enable-darwin-at-runpath'.  Act  on the
      	enable flag to alter Darwin libraries to use @rpath names.
      
      gcc/ChangeLog:
      
      	* aclocal.m4: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      	* config/darwin.h: Handle Darwin rpaths.
      	* config/darwin.opt: Handle Darwin rpaths.
      	* Makefile.in:  Handle Darwin rpaths.
      
      gcc/ada/ChangeLog:
      
      	* gcc-interface/Makefile.in: Handle Darwin rpaths.
      
      gcc/jit/ChangeLog:
      	* Make-lang.in: Handle Darwin rpaths.
      
      libatomic/ChangeLog:
      
      	* Makefile.am: Handle Darwin rpaths.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      
      libbacktrace/ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      
      libcc1/ChangeLog:
      
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      
      	* Makefile.am: Handle Darwin rpaths.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      
      libgcc/ChangeLog:
      
      	* config/t-slibgcc-darwin: Generate libgcc_s
      	with an @rpath name.
      	* config.host: Handle Darwin rpaths.
      
      libgfortran/ChangeLog:
      
      	* Makefile.am: Handle Darwin rpaths.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths
      
      libgm2/ChangeLog:
      
      	* Makefile.am: Handle Darwin rpaths.
      	* Makefile.in: Regenerate.
      	* aclocal.m4: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      	* libm2cor/Makefile.am: Handle Darwin rpaths.
      	* libm2cor/Makefile.in: Regenerate.
      	* libm2iso/Makefile.am: Handle Darwin rpaths.
      	* libm2iso/Makefile.in: Regenerate.
      	* libm2log/Makefile.am: Handle Darwin rpaths.
      	* libm2log/Makefile.in: Regenerate.
      	* libm2min/Makefile.am: Handle Darwin rpaths.
      	* libm2min/Makefile.in: Regenerate.
      	* libm2pim/Makefile.am: Handle Darwin rpaths.
      	* libm2pim/Makefile.in: Regenerate.
      
      libgomp/ChangeLog:
      
      	* Makefile.am: Handle Darwin rpaths.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths
      
      libitm/ChangeLog:
      
      	* Makefile.am: Handle Darwin rpaths.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      
      libobjc/ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      
      libphobos/ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      	* libdruntime/Makefile.am: Handle Darwin rpaths.
      	* libdruntime/Makefile.in: Regenerate.
      	* src/Makefile.am: Handle Darwin rpaths.
      	* src/Makefile.in: Regenerate.
      
      libquadmath/ChangeLog:
      
      	* Makefile.am: Handle Darwin rpaths.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      
      libsanitizer/ChangeLog:
      
      	* asan/Makefile.am: Handle Darwin rpaths.
      	* asan/Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* hwasan/Makefile.am: Handle Darwin rpaths.
      	* hwasan/Makefile.in: Regenerate.
      	* lsan/Makefile.am: Handle Darwin rpaths.
      	* lsan/Makefile.in: Regenerate.
      	* tsan/Makefile.am: Handle Darwin rpaths.
      	* tsan/Makefile.in: Regenerate.
      	* ubsan/Makefile.am: Handle Darwin rpaths.
      	* ubsan/Makefile.in: Regenerate.
      
      libssp/ChangeLog:
      
      	* Makefile.am: Handle Darwin rpaths.
      	* Makefile.in: Regenerate.
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      
      libstdc++-v3/ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      	* src/Makefile.am: Handle Darwin rpaths.
      	* src/Makefile.in: Regenerate.
      
      libvtv/ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      
      lto-plugin/ChangeLog:
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      
      zlib/ChangeLog:
      	* configure: Regenerate.
      	* configure.ac: Handle Darwin rpaths.
      6a6d3817
  23. Aug 12, 2023
  24. Aug 11, 2023
    • Joseph Myers's avatar
      config: Fix host -rdynamic detection for build != host != target · 4d9bc81a
      Joseph Myers authored
      The GCC_ENABLE_PLUGINS configure logic for detecting whether -rdynamic
      is necessary and supported uses an appropriate objdump for $host
      binaries (running on $build) in cases where $host is $build or
      $target.
      
      However, it is missing such logic in the case where $host is neither
      $build nor $target, resulting in the compilers not being linked with
      -rdynamic and plugins not being usable with such a compiler.  In fact
      $ac_cv_prog_OBJDUMP, as used when $build = $host, is always an objdump
      for $host binaries that runs on $build; that is, it's appropriate to
      use in this case as well.
      
      Tested in such a configuration that it does result in cc1 being linked
      with -rdynamic as expected.  Also bootstrapped with no regressions for
      x86_64-pc-linux-gnu.
      
      config/
      	* gcc-plugin.m4 (GCC_ENABLE_PLUGINS): Use
      	export_sym_check="$ac_cv_prog_OBJDUMP -T" also when host is not
      	build or target.
      
      gcc/
      	* configure: Regenerate.
      
      libcc1/
      	* configure: Regenerate.
      4d9bc81a
  25. Aug 08, 2023
  26. Aug 07, 2023
    • Nick Alcock's avatar
      libtool.m4: augment symcode for Solaris 11 · dc17ceb3
      Nick Alcock authored
      This reports common symbols like GNU nm, via a type code of 'C'.
      
      ChangeLog:
      
      	* libtool.m4 (lt_cv_sys_global_symbol_pipe): Augment symcode for
      	Solaris 11.
      
      gcc/ChangeLog:
      
      	* configure: Regenerate.
      
      libatomic/ChangeLog:
      
      	* configure: Regenerate.
      
      libbacktrace/ChangeLog:
      
      	* configure: Regenerate.
      
      libcc1/ChangeLog:
      
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      
      	* configure: Regenerate.
      
      libgfortran/ChangeLog:
      
      	* configure: Regenerate.
      
      libgm2/ChangeLog:
      
      	* configure: Regenerate.
      
      libgomp/ChangeLog:
      
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      
      	* configure: Regenerate.
      
      libobjc/ChangeLog:
      
      	* configure: Regenerate.
      
      libphobos/ChangeLog:
      
      	* configure: Regenerate.
      
      libquadmath/ChangeLog:
      
      	* configure: Regenerate.
      
      libsanitizer/ChangeLog:
      
      	* configure: Regenerate.
      
      libssp/ChangeLog:
      
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      
      	* configure: Regenerate.
      
      libvtv/ChangeLog:
      
      	* configure: Regenerate.
      
      lto-plugin/ChangeLog:
      
      	* configure: Regenerate.
      
      zlib/ChangeLog:
      
      	* configure: Regenerate.
      dc17ceb3
    • Alexander von Gluck IV's avatar
      Add support for the haiku operating system · ead5103c
      Alexander von Gluck IV authored
      These are the os support patches we have been grooming and maintaining
      for quite a few years over on git.haiku-os.org.  All of these
      architectures are working and most have been stable for quite some time.
      
      ChangeLog:
      
      	* configure: Regenerate.
      	* configure.ac: Add Haiku to list of ELF OSes
      	* libtool.m4: Update sys_lib_dlsearch_path_spec on Haiku.
      
      gcc/ChangeLog:
      
      	* configure: Regenerate.
      
      libatomic/ChangeLog:
      
      	* configure: Regenerate.
      
      libbacktrace/ChangeLog:
      
      	* configure: Regenerate.
      
      libcc1/ChangeLog:
      
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      
      	* configure: Regenerate.
      
      libgfortran/ChangeLog:
      
      	* configure: Regenerate.
      
      libgm2/ChangeLog:
      
      	* configure: Regenerate.
      
      libgomp/ChangeLog:
      
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      
      	* configure: Regenerate.
      
      libobjc/ChangeLog:
      
      	* configure: Regenerate.
      
      libphobos/ChangeLog:
      
      	* configure: Regenerate.
      
      libquadmath/ChangeLog:
      
      	* configure: Regenerate.
      
      libsanitizer/ChangeLog:
      
      	* configure: Regenerate.
      
      libssp/ChangeLog:
      
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      
      	* configure: Regenerate.
      
      libvtv/ChangeLog:
      
      	* configure: Regenerate.
      
      lto-plugin/ChangeLog:
      
      	* configure: Regenerate.
      
      zlib/ChangeLog:
      
      	* configure: Regenerate.
      ead5103c
    • Nick Alcock's avatar
      libtool.m4: fix the NM="/nm/over/here -B/option/with/path" case · f3307109
      Nick Alcock authored
      My previous nm patch handled all cases but one -- if the user set NM in
      the environment to a path which contained an option, libtool's nm
      detection tries to run nm against a copy of nm with the options in it:
      e.g. if NM was set to "nm --blargle", and nm was found in /usr/bin, the
      test would try to run "/usr/bin/nm --blargle /usr/bin/nm --blargle".
      This is unlikely to be desirable: in this case we should run
      "/usr/bin/nm --blargle /usr/bin/nm".
      
      Furthermore, as part of this nm has to detect when the passed-in $NM
      contains a path, and in that case avoid doing a path search itself.
      This too was thrown off if an option contained something that looked
      like a path, e.g. NM="nm -B../prev-gcc"; libtool then tries to run
      "nm -B../prev-gcc nm" which rarely works well (and indeed it looks
      to see whether that nm exists, finds it doesn't, and wrongly concludes
      that nm -p or whatever does not work).
      
      Fix all of these by clipping all options (defined as everything
      including and after the first " -") before deciding whether nm
      contains a path (but not using the clipped value for anything else),
      and then removing all options from the path-modified nm before
      looking to see whether that nm existed.
      
      NM=my-nm now does a path search and runs e.g.
        /usr/bin/my-nm -B /usr/bin/my-nm
      
      NM=/usr/bin/my-nm now avoids a path search and runs e.g.
        /usr/bin/my-nm -B /usr/bin/my-nm
      
      NM="my-nm -p../wombat" now does a path search and runs e.g.
        /usr/bin/my-nm -p../wombat -B /usr/bin/my-nm
      
      NM="../prev-binutils/new-nm -B../prev-gcc" now avoids a path search:
        ../prev-binutils/my-nm -B../prev-gcc -B ../prev-binutils/my-nm
      
      This seems to be all combinations, including those used by GCC bootstrap
      (which, before this commit, fails to bootstrap when configured
      --with-build-config=bootstrap-lto, because the lto plugin is now using
      --export-symbols-regex, which requires libtool to find a working nm,
      while also using -B../prev-gcc to point at the lto plugin associated
      with the GCC just built.)
      
      Regenerate all affected configure scripts.
      
      ChangeLog:
      
      	* libtool.m4 (LT_PATH_NM): Handle user-specified NM with
      	options, including options containing paths.
      
      gcc/ChangeLog:
      
      	* configure: Regenerate.
      
      libatomic/ChangeLog:
      
      	* configure: Regenerate.
      
      libbacktrace/ChangeLog:
      
      	* configure: Regenerate.
      
      libcc1/ChangeLog:
      
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      
      	* configure: Regenerate.
      
      libgfortran/ChangeLog:
      
      	* configure: Regenerate.
      
      libgm2/ChangeLog:
      
      	* configure: Regenerate.
      
      libgomp/ChangeLog:
      
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      
      	* configure: Regenerate.
      
      libobjc/ChangeLog:
      
      	* configure: Regenerate.
      
      libphobos/ChangeLog:
      
      	* configure: Regenerate.
      
      libquadmath/ChangeLog:
      
      	* configure: Regenerate.
      
      libsanitizer/ChangeLog:
      
      	* configure: Regenerate.
      
      libssp/ChangeLog:
      
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      
      	* configure: Regenerate.
      
      libvtv/ChangeLog:
      
      	* configure: Regenerate.
      
      lto-plugin/ChangeLog:
      
      	* configure: Regenerate.
      
      zlib/ChangeLog:
      
      	* configure: Regenerate.
      f3307109
    • Nick Alcock's avatar
      libtool.m4: fix nm BSD flag detection · ab422974
      Nick Alcock authored
      Libtool needs to get BSD-format (or MS-format) output out of the system
      nm, so that it can scan generated object files for symbol names for
      -export-symbols-regex support.  Some nms need specific flags to turn on
      BSD-formatted output, so libtool checks for this in its AC_PATH_NM.
      Unfortunately the code to do this has a pair of interlocking flaws:
      
       - it runs the test by doing an nm of /dev/null.  Some platforms
         reasonably refuse to do an nm on a device file, but before now this
         has only been worked around by assuming that the error message has a
         specific textual form emitted by Tru64 nm, and that getting this
         error means this is Tru64 nm and that nm -B would work to produce
         BSD-format output, even though the test never actually got anything
         but an error message out of nm -B.  This is fixable by nm'ing *nm
         itself* (since we necessarily have a path to it).
      
       - the test is entirely skipped if NM is set in the environment, on the
         grounds that the user has overridden the test: but the user cannot
         reasonably be expected to know that libtool wants not only nm but
         also flags forcing BSD-format output.  Worse yet, one such "user" is
         the top-level Cygnus configure script, which neither tests for
         nor specifies any BSD-format flags.  So platforms needing BSD-format
         flags always fail to set them when run in a Cygnus tree, breaking
         -export-symbols-regex on such platforms.  Libtool also needs to
         augment $LD on some platforms, but this is done unconditionally,
         augmenting whatever the user specified: the nm check should do the
         same.
      
         One wrinkle: if the user has overridden $NM, a path might have been
         provided: so we use the user-specified path if there was one, and
         otherwise do the path search as usual.  (If the nm specified doesn't
         work, this might lead to a few extra pointless path searches -- but
         the test is going to fail anyway, so that's not a problem.)
      
      (Tested with NM unset, and set to nm, /usr/bin/nm, my-nm where my-nm is a
      symlink to /usr/bin/nm on the PATH, and /not-on-the-path/my-nm where
      *that* is a symlink to /usr/bin/nm.)
      
      ChangeLog:
      
      	* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
      	NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
      	errors from nms that refuse to work on non-regular files.  Remove
      	other workarounds for this problem.  Strip out blank lines from the
      	nm output.
      
      fixincludes/ChangeLog:
      
      	* configure: Regenerate.
      
      gcc/ChangeLog:
      
      	* configure: Regenerate.
      
      libatomic/ChangeLog:
      
      	* configure: Regenerate.
      
      libbacktrace/ChangeLog:
      
      	* configure: Regenerate.
      
      libcc1/ChangeLog:
      
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      
      	* configure: Regenerate.
      
      libgfortran/ChangeLog:
      
      	* configure: Regenerate.
      
      libgm2/ChangeLog:
      
      	* configure: Regenerate.
      
      libgomp/ChangeLog:
      
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      
      	* configure: Regenerate.
      
      libobjc/ChangeLog:
      
      	* configure: Regenerate.
      
      libphobos/ChangeLog:
      
      	* configure: Regenerate.
      
      libquadmath/ChangeLog:
      
      	* configure: Regenerate.
      
      libsanitizer/ChangeLog:
      
      	* configure: Regenerate.
      
      libssp/ChangeLog:
      
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      
      	* configure: Regenerate.
      
      libvtv/ChangeLog:
      
      	* configure: Regenerate.
      
      lto-plugin/ChangeLog:
      
      	* configure: Regenerate.
      
      zlib/ChangeLog:
      
      	* configure: Regenerate.
      ab422974
    • H.J. Lu's avatar
      GCC: Check if AR works with --plugin and rc · 9c7797a8
      H.J. Lu authored
      AR from older binutils doesn't work with --plugin and rc:
      
      [hjl@gnu-cfl-2 bin]$ touch foo.c
      [hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
      [hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c
      ./ar: no operation specified
      [hjl@gnu-cfl-2 bin]$ ./ar --version
      GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112
      Copyright (C) 2018 Free Software Foundation, Inc.
      This program is free software; you may redistribute it under the terms of
      the GNU General Public License version 3 or (at your option) any later version.
      This program has absolutely no warranty.
      [hjl@gnu-cfl-2 bin]$
      
      Check if AR works with --plugin and rc before passing --plugin to AR and
      RANLIB.
      
      ChangeLog:
      
      	* configure: Regenerated.
      	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with
      	--plugin and rc before enabling --plugin.
      
      config/ChangeLog:
      
      	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with
      	--plugin and rc before enabling --plugin.
      
      gcc/ChangeLog:
      
      	* configure: Regenerate.
      
      libatomic/ChangeLog:
      
      	* configure: Regenerate.
      
      libbacktrace/ChangeLog:
      
      	* configure: Regenerate.
      
      libcc1/ChangeLog:
      
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      
      	* configure: Regenerate.
      
      libgfortran/ChangeLog:
      
      	* configure: Regenerate.
      
      libgm2/ChangeLog:
      
      	* configure: Regenerate.
      
      libgomp/ChangeLog:
      
      	* configure: Regenerate.
      
      libiberty/ChangeLog:
      
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      
      	* configure: Regenerate.
      
      libobjc/ChangeLog:
      
      	* configure: Regenerate.
      
      libphobos/ChangeLog:
      
      	* configure: Regenerate.
      
      libquadmath/ChangeLog:
      
      	* configure: Regenerate.
      
      libsanitizer/ChangeLog:
      
      	* configure: Regenerate.
      
      libssp/ChangeLog:
      
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      
      	* configure: Regenerate.
      
      libvtv/ChangeLog:
      
      	* configure: Regenerate.
      
      lto-plugin/ChangeLog:
      
      	* configure: Regenerate.
      
      zlib/ChangeLog:
      
      	* configure: Regenerate.
      9c7797a8
    • H.J. Lu's avatar
      Sync with binutils: GCC: Pass --plugin to AR and RANLIB · 126f707e
      H.J. Lu authored
      Sync with binutils for building binutils with LTO:
      
      50ad1254d50 GCC: Pass --plugin to AR and RANLIB
      
      Detect GCC LTO plugin.  Pass --plugin to AR and RANLIB to support LTO
      build.
      
      ChangeLog:
      
      	* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
      	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
      	* configure.ac: Include config/gcc-plugin.m4.
      	AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
      	* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
      	RANLIB if possible.
      	* Makefile.in: Regenerated.
      	* configure: Likewise.
      
      config/ChangeLog:
      
      	* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.
      
      libiberty/ChangeLog:
      
      	* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
      	(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
      	(configure_deps): Depend on ../config/gcc-plugin.m4.
      	* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
      	RANLIB_PLUGIN_OPTION.
      	* aclocal.m4: Regenerated.
      	* configure: Likewise.
      
      zlib/ChangeLog:
      
      	* configure: Regenerated.
      
      gcc/ChangeLog:
      
      	* configure: Regenerate.
      
      libatomic/ChangeLog:
      
      	* configure: Regenerate.
      
      libbacktrace/ChangeLog:
      
      	* configure: Regenerate.
      
      libcc1/ChangeLog:
      
      	* configure: Regenerate.
      
      libffi/ChangeLog:
      
      	* configure: Regenerate.
      
      libgfortran/ChangeLog:
      
      	* configure: Regenerate.
      
      libgm2/ChangeLog:
      
      	* configure: Regenerate.
      
      libgomp/ChangeLog:
      
      	* configure: Regenerate.
      
      libitm/ChangeLog:
      
      	* configure: Regenerate.
      
      libobjc/ChangeLog:
      
      	* configure: Regenerate.
      
      libphobos/ChangeLog:
      
      	* configure: Regenerate.
      
      libquadmath/ChangeLog:
      
      	* configure: Regenerate.
      
      libsanitizer/ChangeLog:
      
      	* configure: Regenerate.
      
      libssp/ChangeLog:
      
      	* configure: Regenerate.
      
      libstdc++-v3/ChangeLog:
      
      	* configure: Regenerate.
      
      libvtv/ChangeLog:
      
      	* configure: Regenerate.
      
      lto-plugin/ChangeLog:
      
      	* configure: Regenerate.
      126f707e
  27. May 19, 2023
  28. May 18, 2023
    • Bernhard Reutner-Fischer's avatar
      c: use _P() defines from tree.h · 9157b213
      Bernhard Reutner-Fischer authored
      gcc/c-family/ChangeLog:
      
      	* c-ada-spec.cc (has_static_fields): Use _P() defines from tree.h.
      	(dump_ada_declaration): Ditto.
      	(dump_ada_structure): Ditto.
      	* c-common.cc (unsafe_conversion_p): Ditto.
      	(shorten_compare): Ditto.
      	(pointer_int_sum): Ditto.
      	(c_common_truthvalue_conversion): Ditto.
      	(scalar_to_vector): Ditto.
      	* c-common.h (gnu_vector_type_p): Ditto.
      	* c-omp.cc (c_omp_depend_t_p): Ditto.
      	(c_omp_split_clauses): Ditto.
      	* c-ubsan.cc (ubsan_instrument_division): Ditto.
      	* c-warn.cc (conversion_warning): Ditto.
      	(warnings_for_convert_and_check): Ditto.
      
      gcc/c/ChangeLog:
      
      	* c-convert.cc (c_convert): Ditto.
      	* c-decl.cc (merge_decls): Ditto.
      	* c-parser.cc (c_parser_omp_clause_reduction): Ditto.
      	(c_parser_omp_declare_reduction): Ditto.
      	* c-typeck.cc (build_component_ref): Ditto.
      	(convert_argument): Ditto.
      	(pointer_diff): Ditto.
      	(build_unary_op): Ditto.
      	(build_c_cast): Ditto.
      	(build_modify_expr): Ditto.
      	(store_init_value): Ditto.
      	(constexpr_init_fits_real_type): Ditto.
      	(check_constexpr_init): Ditto.
      	(c_finish_return): Ditto.
      	(handle_omp_array_sections_1): Ditto.
      	(c_finish_omp_clauses): Ditto.
      	* gimple-parser.cc (c_finish_gimple_return): Ditto.
      
      libcc1/ChangeLog:
      
      	* libcc1plugin.cc (plugin_float_type): Ditto.
      	* libcp1plugin.cc (plugin_reactivate_decl): Ditto.
      	(plugin_get_float_type): Ditto.
      9157b213
  29. Jan 16, 2023
  30. Nov 02, 2022
  31. Nov 01, 2022
    • Nathan Sidwell's avatar
      c++: per-scope, per-signature lambda discriminators · 2b0e81d5
      Nathan Sidwell authored
      This implements ABI-compliant lambda discriminators.  Not only do we
      have per-scope counters, but we also distinguish by lambda signature.
      Only lambdas with the same signature will need non-zero
      discriminators.  As the discriminator is signature-dependent, we have
      to process the lambda function's declaration before we can determine
      it.  For templated and generic lambdas the signature is that of the
      uninstantiated lambda -- not separate for each instantiation.
      
      With this change, gcc and clang now produce the same lambda manglings
      for all these testcases.
      
      	gcc/cp/
      	* cp-tree.h (LAMBDA_EXPR_SCOPE_SIG_DISCRIMINATOR): New.
      	(struct tree_lambda_expr): Add discriminator_sig bitfield.
      	(recrd_lambda_scope_sig_discriminator): Declare.
      	* lambda.cc (struct lambda_sig_count): New.
      	(lambda_discriminator): Add signature vector.
      	(start_lambda_scope): Adjust.
      	(compare_lambda_template_head, compare_lambda_sig): New.
      	(record_lambda_scope_sig_discriminator): New.
      	* mangle.cc (write_closure_type): Use the scope-sig discriminator for
      	ABI >= 18.  Emit abi mangling warning if needed.
      	* module.cc (trees_out::core_vals): Stream the new discriminator.
      	(trees_in::core_vals): Likewise.
      	* parser.cc (cp_parser_lambda_declarator_opt): Call
      	record_lambda_scope_sig_discriminator.
      	* pt.cc (tsubst_lambda_expr): Likewise.
      	libcc1/
      	* libcp1plugin.cc (plugin_start_lambda_closure_class_type):
      	Initialize the per-scope, per-signature discriminator.
      	gcc/testsuite/
      	* g++.dg/abi/lambda-sig1-18.C: New.
      	* g++.dg/abi/lambda-sig1-18vs17.C: New.
      	* g++.dg/cpp1y/lambda-mangle-1-18.C: New.
      2b0e81d5
    • Nathan Sidwell's avatar
      c++: Reorganize per-scope lambda discriminators · 0122faae
      Nathan Sidwell authored
      We currently use a per-extra-scope counter to discriminate multiple
      lambdas in a particular such scope.  This is not ABI compliant.  This
      patch merely refactors the existing code to make it easier to drop in
      a conformant mangling -- there's no functional change here.  I rename
      the LAMBDA_EXPR_DISCIMINATOR to LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR,
      foreshadowing that there'll be a new discriminator.  To provide ABI
      warnings we'll need to calculate both, and that requires some
      repacking of the lambda_expr's fields.  Finally, although we end up
      calling the discriminator setter and the scope recorder (nearly)
      always consecutively, it's clearer to handle it as two separate
      operations.  That also allows us to remove the instantiation
      special-case for a null extra-scope.
      
      	gcc/cp/
      	* cp-tree.h (LAMBDA_EXPR_DISCRIMINATOR): Rename to ...
      	(LAMBDA_EXPR_SCOPE_ONLY_DISCRIMINATOR): ... here.
      	(struct tree_lambda_expr): Make default_capture_mode &
      	discriminator_scope bitfields.
      	(record_null_lambda_scope) Delete.
      	(record_lambda_scope_discriminator): Declare.
      	* lambda.cc (struct lambda_discriminator): New struct.
      	(lambda_scope, lambda_scope_stack): Adjust types.
      	(lambda_count): Delete.
      	(struct tree_int): Delete.
      	(start_lambda_scope, finish_lambda_scope): Adjust.
      	(record_lambda_scope): Only record the scope.
      	(record_lambda_scope_discriminator): New.
      	* mangle.cc (write_closure_type_name): Adjust.
      	* module.cc (trees_out::core_vals): Likewise,
      	(trees_in::core_vals): Likewise.
      	* parser.cc (cp_parser_lambda_expression): Call
      	record_lambda_scope_discriminator.
      	* pt.cc (tsubst_lambda_expr): Adjust record_lambda_scope caling.  Call
      	record_lambda_scope_discriminator. Commonize control flow on tsubsting
      	the operator function.
      	libcc1/
      	* libcp1plugin.cc (plugin_start_closure): Adjust.
      	gcc/testsuite/
      	* g++.dg/abi/lambda-sig1-17.C: New.
      	* g++.dg/abi/lambda-sig1.h: New.
      	* g++.dg/cpp1y/lambda-mangle-1.C: Extracted to ...
      	* g++.dg/cpp1y/lambda-mangle-1.h: ... here.
      	* g++.dg/cpp1y/lambda-mangle-1-11.C: New
      	* g++.dg/cpp1y/lambda-mangle-1-17.C
      0122faae
  32. Oct 13, 2022
Loading