aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit
AgeCommit message (Collapse)AuthorFilesLines
2024-01-03Update copyright years.Jakub Jelinek69-110/+110
2024-01-03Update Copyright year in ChangeLog filesJakub Jelinek1-1/+1
2023 -> 2024
2023-12-07Daily bump.GCC Administrator1-0/+11
2023-12-06diagnostics: use const and references for diagnostic_infoDavid Malcolm3-6/+7
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: David Malcolm <dmalcolm@redhat.com>
2023-12-06Daily bump.GCC Administrator1-0/+6
2023-12-05Restore build with GCC 4.8 to GCC 5Richard Sandiford1-2/+2
GCC 5 and earlier applied array-to-pointer decay too early, which affected the new attribute namespace code. A reduced example of the construct that the attribute code uses is: struct S { template<__SIZE_TYPE__ N> S(int (&)[N]); }; struct T { int a; S b; }; int a[] = { 1 }; T t = { 1, a }; This was fixed by f85e1317f8ea933f5c615680353bd646f480f7d3 (PR 16333 et al). This patch tries to add a minimally-invasive workaround. gcc/ada/ * gcc-interface/utils.cc (gnat_internal_attribute_table): Add extra braces to work around PR 16333 in older compilers. gcc/ * attribs.cc (handle_ignored_attributes_option): Add extra braces to work around PR 16333 in older compilers. * config/aarch64/aarch64.cc (aarch64_gnu_attribute_table): Likewise. (aarch64_arm_attribute_table): Likewise. * config/arm/arm.cc (arm_gnu_attribute_table): Likewise. * config/i386/i386-options.cc (ix86_gnu_attribute_table): Likewise. * config/ia64/ia64.cc (ia64_gnu_attribute_table): Likewise. * config/rs6000/rs6000.cc (rs6000_gnu_attribute_table): Likewise. * target-def.h (TARGET_GNU_ATTRIBUTES): Likewise. * genhooks.cc (emit_init_macros): Likewise, when emitting the instantiation of TARGET_ATTRIBUTE_TABLE. * langhooks-def.h (LANG_HOOKS_INITIALIZER): Likewise, when instantiating LANG_HOOKS_ATTRIBUTE_TABLE. (LANG_HOOKS_ATTRIBUTE_TABLE): Define to be empty by default. * target.def (attribute_table): Likewise. gcc/c-family/ * c-attribs.cc (c_common_gnu_attribute_table): Add extra braces to work around PR 16333 in older compilers. gcc/c/ * c-decl.cc (std_attribute_table): Add extra braces to work around PR 16333 in older compilers. gcc/cp/ * tree.cc (cxx_gnu_attribute_table): Add extra braces to work around PR 16333 in older compilers. gcc/d/ * d-attribs.cc (d_langhook_common_attribute_table): Add extra braces to work around PR 16333 in older compilers. (d_langhook_gnu_attribute_table): Likewise. gcc/fortran/ * f95-lang.cc (gfc_gnu_attribute_table): Add extra braces to work around PR 16333 in older compilers. gcc/jit/ * dummy-frontend.cc (jit_gnu_attribute_table): Add extra braces to work around PR 16333 in older compilers. (jit_format_attribute_table): Likewise. gcc/lto/ * lto-lang.cc (lto_gnu_attribute_table): Add extra braces to work around PR 16333 in older compilers. (lto_format_attribute_table): Likewise.
2023-12-03Daily bump.GCC Administrator1-0/+13
2023-12-02Allow target attributes in non-gnu namespacesRichard Sandiford1-10/+22
Currently there are four static sources of attributes: - LANG_HOOKS_ATTRIBUTE_TABLE - LANG_HOOKS_COMMON_ATTRIBUTE_TABLE - LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE - TARGET_ATTRIBUTE_TABLE All of the attributes in these tables go in the "gnu" namespace. This means that they can use the traditional GNU __attribute__((...)) syntax and the standard [[gnu::...]] syntax. Standard attributes are registered dynamically with a null namespace. There are no supported attributes in other namespaces (clang, vendor namespaces, etc.). This patch tries to generalise things by making the namespace part of the attribute specification. It's usual for multiple attributes to be defined in the same namespace, so rather than adding the namespace to each individual definition, it seemed better to group attributes in the same namespace together. This would also allow us to reuse the same table for clang attributes that are written with the GNU syntax, or other similar situations where the attribute can be accessed via multiple "spellings". The patch therefore adds a scoped_attribute_specs that contains a namespace and a list of attributes in that namespace. It's still possible to have multiple scoped_attribute_specs for the same namespace. E.g. it makes sense to keep the C++-specific, C/C++-common, and format-related attributes in separate tables, even though they're all GNU attributes. Current lists of attributes are terminated by a null name. Rather than keep that for the new structure, it seemed neater to use an array_slice. This also makes the tables slighly more compact. In general, a target might want to support attributes in multiple namespaces. Rather than have a separate hook for each possibility (like the three langhooks above), it seemed better to make TARGET_ATTRIBUTE_TABLE a table of tables. Specifically, it's an array_slice of scoped_attribute_specs. We can do the same thing for langhooks, which allows the three hooks above to be merged into a single LANG_HOOKS_ATTRIBUTE_TABLE. It also allows the standard attributes to be registered statically and checked by the usual attribs.cc checks. The patch adds a TARGET_GNU_ATTRIBUTES helper for the common case in which a target wants a single table of gnu attributes. It can only be used if the table is free of preprocessor directives. There are probably other things we need to do to make vendor namespaces work smoothly. E.g. in principle it would be good to make exclusion sets namespace-aware. But to some extent we have that with standard vs. gnu attributes too. This patch is just supposed to be a first step. gcc/ * attribs.h (scoped_attribute_specs): New structure. (register_scoped_attributes): Take a reference to a scoped_attribute_specs instead of separate namespace and array parameters. * plugin.h (register_scoped_attributes): Likewise. * attribs.cc (register_scoped_attributes): Likewise. (attribute_tables): Change into an array of scoped_attribute_specs pointers. Reduce to 1 element for frontends and 1 element for targets. (empty_attribute_table): Delete. (check_attribute_tables): Update for changes to attribute_tables. Use a hash_set to identify duplicates. (handle_ignored_attributes_option): Update for above changes. (init_attributes): Likewise. (excl_pair): Delete. (test_attribute_exclusions): Update for above changes. Don't enforce symmetry for standard attributes in the top-level namespace. * langhooks-def.h (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete. (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Likewise. (LANG_HOOKS_INITIALIZER): Update accordingly. (LANG_HOOKS_ATTRIBUTE_TABLE): Define to an empty constructor. * langhooks.h (lang_hooks::common_attribute_table): Delete. (lang_hooks::format_attribute_table): Likewise. (lang_hooks::attribute_table): Redefine to an array of scoped_attribute_specs pointers. * target-def.h (TARGET_GNU_ATTRIBUTES): New macro. * target.def (attribute_spec): Redefine to return an array of scoped_attribute_specs pointers. * tree-inline.cc (function_attribute_inlinable_p): Update accordingly. * doc/tm.texi: Regenerate. * config/aarch64/aarch64.cc (aarch64_attribute_table): Define using TARGET_GNU_ATTRIBUTES. * config/alpha/alpha.cc (vms_attribute_table): Likewise. * config/avr/avr.cc (avr_attribute_table): Likewise. * config/bfin/bfin.cc (bfin_attribute_table): Likewise. * config/bpf/bpf.cc (bpf_attribute_table): Likewise. * config/csky/csky.cc (csky_attribute_table): Likewise. * config/epiphany/epiphany.cc (epiphany_attribute_table): Likewise. * config/gcn/gcn.cc (gcn_attribute_table): Likewise. * config/h8300/h8300.cc (h8300_attribute_table): Likewise. * config/loongarch/loongarch.cc (loongarch_attribute_table): Likewise. * config/m32c/m32c.cc (m32c_attribute_table): Likewise. * config/m32r/m32r.cc (m32r_attribute_table): Likewise. * config/m68k/m68k.cc (m68k_attribute_table): Likewise. * config/mcore/mcore.cc (mcore_attribute_table): Likewise. * config/microblaze/microblaze.cc (microblaze_attribute_table): Likewise. * config/mips/mips.cc (mips_attribute_table): Likewise. * config/msp430/msp430.cc (msp430_attribute_table): Likewise. * config/nds32/nds32.cc (nds32_attribute_table): Likewise. * config/nvptx/nvptx.cc (nvptx_attribute_table): Likewise. * config/riscv/riscv.cc (riscv_attribute_table): Likewise. * config/rl78/rl78.cc (rl78_attribute_table): Likewise. * config/rx/rx.cc (rx_attribute_table): Likewise. * config/s390/s390.cc (s390_attribute_table): Likewise. * config/sh/sh.cc (sh_attribute_table): Likewise. * config/sparc/sparc.cc (sparc_attribute_table): Likewise. * config/stormy16/stormy16.cc (xstormy16_attribute_table): Likewise. * config/v850/v850.cc (v850_attribute_table): Likewise. * config/visium/visium.cc (visium_attribute_table): Likewise. * config/arc/arc.cc (arc_attribute_table): Likewise. Move further down file. * config/arm/arm.cc (arm_attribute_table): Update for above changes, using... (arm_gnu_attributes, arm_gnu_attribute_table): ...these new globals. * config/i386/i386-options.h (ix86_attribute_table): Delete. (ix86_gnu_attribute_table): Declare. * config/i386/i386-options.cc (ix86_attribute_table): Replace with... (ix86_gnu_attributes, ix86_gnu_attribute_table): ...these two globals. * config/i386/i386.cc (ix86_attribute_table): Define as an array of scoped_attribute_specs pointers. * config/ia64/ia64.cc (ia64_attribute_table): Update for above changes, using... (ia64_gnu_attributes, ia64_gnu_attribute_table): ...these new globals. * config/rs6000/rs6000.cc (rs6000_attribute_table): Update for above changes, using... (rs6000_gnu_attributes, rs6000_gnu_attribute_table): ...these new globals. gcc/ada/ * gcc-interface/gigi.h (gnat_internal_attribute_table): Change type to scoped_attribute_specs. * gcc-interface/utils.cc (gnat_internal_attribute_table): Likewise, using... (gnat_internal_attributes): ...this as the underlying array. * gcc-interface/misc.cc (gnat_attribute_table): New global. (LANG_HOOKS_ATTRIBUTE_TABLE): Use it. gcc/c-family/ * c-common.h (c_common_attribute_table): Replace with... (c_common_gnu_attribute_table): ...this. (c_common_format_attribute_table): Change type to scoped_attribute_specs. * c-attribs.cc (c_common_attribute_table): Replace with... (c_common_gnu_attributes, c_common_gnu_attribute_table): ...these new globals. (c_common_format_attribute_table): Change type to scoped_attribute_specs, using... (c_common_format_attributes): ...this as the underlying array. gcc/c/ * c-tree.h (std_attribute_table): Declare. * c-decl.cc (std_attribute_table): Change type to scoped_attribute_specs, using... (std_attributes): ...this as the underlying array. (c_init_decl_processing): Remove call to register_scoped_attributes. * c-objc-common.h (c_objc_attribute_table): New global. (LANG_HOOKS_ATTRIBUTE_TABLE): Use it. (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete. (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete. gcc/cp/ * cp-tree.h (cxx_attribute_table): Delete. (cxx_gnu_attribute_table, std_attribute_table): Declare. * cp-objcp-common.h (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete. (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete. (cp_objcp_attribute_table): New table. (LANG_HOOKS_ATTRIBUTE_TABLE): Redefine. * tree.cc (cxx_attribute_table): Replace with... (cxx_gnu_attributes, cxx_gnu_attribute_table): ...these globals. (std_attribute_table): Change type to scoped_attribute_specs, using... (std_attributes): ...this as the underlying array. (init_tree): Remove call to register_scoped_attributes. gcc/d/ * d-tree.h (d_langhook_attribute_table): Replace with... (d_langhook_gnu_attribute_table): ...this. (d_langhook_common_attribute_table): Change type to scoped_attribute_specs. * d-attribs.cc (d_langhook_common_attribute_table): Change type to scoped_attribute_specs, using... (d_langhook_common_attributes): ...this as the underlying array. (d_langhook_attribute_table): Replace with... (d_langhook_gnu_attributes, d_langhook_gnu_attribute_table): ...these new globals. (uda_attribute_p): Update accordingly, and update for new targetm.attribute_table type. * d-lang.cc (d_langhook_attribute_table): New global. (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete. gcc/fortran/ * f95-lang.cc: Include attribs.h. (gfc_attribute_table): Change to an array of scoped_attribute_specs pointers, using... (gfc_gnu_attributes, gfc_gnu_attribute_table): ...these new globals. gcc/jit/ * dummy-frontend.cc (jit_format_attribute_table): Change type to scoped_attribute_specs, using... (jit_format_attributes): ...this as the underlying array. (jit_attribute_table): Change to an array of scoped_attribute_specs pointers, using... (jit_gnu_attributes, jit_gnu_attribute_table): ...these new globals for the original array. Include the format attributes. (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete. (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete. (LANG_HOOKS_ATTRIBUTE_TABLE): Define. gcc/lto/ * lto-lang.cc (lto_format_attribute_table): Change type to scoped_attribute_specs, using... (lto_format_attributes): ...this as the underlying array. (lto_attribute_table): Change to an array of scoped_attribute_specs pointers, using... (lto_gnu_attributes, lto_gnu_attribute_table): ...these new globals for the original array. Include the format attributes. (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Delete. (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Delete. (LANG_HOOKS_ATTRIBUTE_TABLE): Define.
2023-11-14Daily bump.GCC Administrator1-0/+4
2023-11-09Add missing declaration of get_restrict in C++ interfaceGuillaume Gomez1-0/+1
gcc/jit/ChangeLog: * libgccjit++.h:
2023-11-05Daily bump.GCC Administrator1-0/+5
2023-11-03diagnostics: convert diagnostic_context to a classDavid Malcolm2-3/+3
This patch: - converts "struct diagnostic_context" to "class diagnostic_context". - ensures all data members have an "m_" prefix, except for "printer", which has so many uses that renaming would be painful. - makes most of the data members private - converts much of the diagnostic_* functions to member functions of diagnostic_context, adding compatibility wrappers for users such as the Fortran frontend, and making as many as possible private. No functional change intended. gcc/ChangeLog: * common.opt (fdiagnostics-text-art-charset=): Remove refererence to diagnostic-text-art.h. * coretypes.h (struct diagnostic_context): Replace forward decl with... (class diagnostic_context): ...this. * diagnostic-format-json.cc: Update for changes to diagnostic_context. * diagnostic-format-sarif.cc: Likewise. * diagnostic-show-locus.cc: Likewise. * diagnostic-text-art.h: Deleted file, moving content... (enum diagnostic_text_art_charset): ...to diagnostic.h, (DIAGNOSTICS_TEXT_ART_CHARSET_DEFAULT): ...deleting, (diagnostics_text_art_charset_init): ...deleting in favor of diagnostic_context::set_text_art_charset. * diagnostic.cc: Remove include of "diagnostic-text-art.h". (pedantic_warning_kind): Update for field renaming. (permissive_error_kind): Likewise. (permissive_error_option): Likewise. (diagnostic_initialize): Convert to... (diagnostic_context::initialize): ...this, updating for field renamings. (diagnostic_color_init): Convert to... (diagnostic_context::color_init): ...this. (diagnostic_urls_init): Convert to... (diagnostic_context::urls_init): ...this. (diagnostic_initialize_input_context): Convert to... (diagnostic_context::initialize_input_context): ...this. (diagnostic_finish): Convert to... (diagnostic_context::finish): ...this, updating for field renamings. (diagnostic_context::set_output_format): New. (diagnostic_context::set_client_data_hooks): New. (diagnostic_context::create_edit_context): New. (diagnostic_converted_column): Convert to... (diagnostic_context::converted_column): ...this. (diagnostic_get_location_text): Update for field renaming. (diagnostic_check_max_errors): Convert to... (diagnostic_context::check_max_errors): ...this, updating for field renamings. (diagnostic_action_after_output): Convert to... (diagnostic_context::action_after_output): ...this, updating for field renamings. (last_module_changed_p): Delete. (set_last_module): Delete. (includes_seen): Convert to... (diagnostic_context::includes_seen_p): ...this, updating for field renamings. (diagnostic_report_current_module): Convert to... (diagnostic_context::report_current_module): ...this, updating for field renamings, and replacing uses of last_module_changed_p and set_last_module to simple field accesses. (diagnostic_show_any_path): Convert to... (diagnostic_context::show_any_path): ...this. (diagnostic_classify_diagnostic): Convert to... (diagnostic_context::classify_diagnostic): ...this, updating for field renamings. (diagnostic_push_diagnostics): Convert to... (diagnostic_context::push_diagnostics): ...this, updating for field renamings. (diagnostic_pop_diagnostics): Convert to... (diagnostic_context::pop_diagnostics): ...this, updating for field renamings. (get_any_inlining_info): Convert to... (diagnostic_context::get_any_inlining_info): ...this, updating for field renamings. (update_effective_level_from_pragmas): Convert to... (diagnostic_context::update_effective_level_from_pragmas): ...this, updating for field renamings. (print_any_cwe): Convert to... (diagnostic_context::print_any_cwe): ...this. (print_any_rules): Convert to... (diagnostic_context::print_any_rules): ...this. (print_option_information): Convert to... (diagnostic_context::print_option_information): ...this, updating for field renamings. (diagnostic_enabled): Convert to... (diagnostic_context::diagnostic_enabled): ...this, updating for field renamings. (warning_enabled_at): Convert to... (diagnostic_context::warning_enabled_at): ...this. (diagnostic_report_diagnostic): Convert to... (diagnostic_context::report_diagnostic): ...this, updating for field renamings and conversions to member functions. (diagnostic_append_note): Update for field renaming. (diagnostic_impl): Use diagnostic_context::report_diagnostic directly. (diagnostic_n_impl): Likewise. (diagnostic_emit_diagram): Convert to... (diagnostic_context::emit_diagram): ...this, updating for field renamings. (error_recursion): Convert to... (diagnostic_context::error_recursion): ...this. (diagnostic_text_output_format::~diagnostic_text_output_format): Use accessor. (diagnostics_text_art_charset_init): Convert to... (diagnostic_context::set_text_art_charset): ...this. (assert_location_text): Update for field renamings. * diagnostic.h (enum diagnostic_text_art_charset): Move here from diagnostic-text-art.h. (struct diagnostic_context): Convert to... (class diagnostic_context): ...this. (diagnostic_context::ice_handler_callback_t): New typedef. (diagnostic_context::set_locations_callback_t): New typedef. (diagnostic_context::initialize): New decl. (diagnostic_context::color_init): New decl. (diagnostic_context::urls_init): New decl. (diagnostic_context::file_cache_init): New decl. (diagnostic_context::finish): New decl. (diagnostic_context::set_set_locations_callback): New. (diagnostic_context::initialize_input_context): New decl. (diagnostic_context::warning_enabled_at): New decl. (diagnostic_context::option_unspecified_p): New. (diagnostic_context::report_diagnostic): New decl. (diagnostic_context::report_current_module): New decl. (diagnostic_context::check_max_errors): New decl. (diagnostic_context::action_after_output): New decl. (diagnostic_context::classify_diagnostic): New decl. (diagnostic_context::push_diagnostics): New decl. (diagnostic_context::pop_diagnostics): New decl. (diagnostic_context::emit_diagram): New decl. (diagnostic_context::set_output_format): New decl. (diagnostic_context::set_text_art_charset): New decl. (diagnostic_context::set_client_data_hooks): New decl. (diagnostic_context::create_edit_context): New decl. (diagnostic_context::set_warning_as_error_requested): New. (diagnostic_context::set_report_bug): New. (diagnostic_context::set_extra_output_kind): New. (diagnostic_context::set_show_cwe): New. (diagnostic_context::set_show_rules): New. (diagnostic_context::set_path_format): New. (diagnostic_context::set_show_path_depths): New. (diagnostic_context::set_show_option_requested): New. (diagnostic_context::set_max_errors): New. (diagnostic_context::set_escape_format): New. (diagnostic_context::set_ice_handler_callback): New. (diagnostic_context::warning_as_error_requested_p): New. (diagnostic_context::show_path_depths_p): New. (diagnostic_context::get_path_format): New. (diagnostic_context::get_escape_format): New. (diagnostic_context::get_file_cache): New. (diagnostic_context::get_edit_context): New. (diagnostic_context::get_client_data_hooks): New. (diagnostic_context::get_diagram_theme): New. (diagnostic_context::converted_column): New decl. (diagnostic_context::diagnostic_count): New. (diagnostic_context::includes_seen_p): New decl. (diagnostic_context::print_any_cwe): New decl. (diagnostic_context::print_any_rules): New decl. (diagnostic_context::print_option_information): New decl. (diagnostic_context::show_any_path): New decl. (diagnostic_context::error_recursion): New decl. (diagnostic_context::diagnostic_enabled): New decl. (diagnostic_context::get_any_inlining_info): New decl. (diagnostic_context::update_effective_level_from_pragmas): New decl. (diagnostic_context::m_file_cache): Make private. (diagnostic_context::diagnostic_count): Rename to... (diagnostic_context::m_diagnostic_count): ...this and make private. (diagnostic_context::warning_as_error_requested): Rename to... (diagnostic_context::m_warning_as_error_requested): ...this and make private. (diagnostic_context::n_opts): Rename to... (diagnostic_context::m_n_opts): ...this and make private. (diagnostic_context::classify_diagnostic): Rename to... (diagnostic_context::m_classify_diagnostic): ...this and make private. (diagnostic_context::classification_history): Rename to... (diagnostic_context::m_classification_history): ...this and make private. (diagnostic_context::n_classification_history): Rename to... (diagnostic_context::m_n_classification_history): ...this and make private. (diagnostic_context::push_list): Rename to... (diagnostic_context::m_push_list): ...this and make private. (diagnostic_context::n_push): Rename to... (diagnostic_context::m_n_push): ...this and make private. (diagnostic_context::show_cwe): Rename to... (diagnostic_context::m_show_cwe): ...this and make private. (diagnostic_context::show_rules): Rename to... (diagnostic_context::m_show_rules): ...this and make private. (diagnostic_context::path_format): Rename to... (diagnostic_context::m_path_format): ...this and make private. (diagnostic_context::show_path_depths): Rename to... (diagnostic_context::m_show_path_depths): ...this and make private. (diagnostic_context::show_option_requested): Rename to... (diagnostic_context::m_show_option_requested): ...this and make private. (diagnostic_context::abort_on_error): Rename to... (diagnostic_context::m_abort_on_error): ...this. (diagnostic_context::show_column): Rename to... (diagnostic_context::m_show_column): ...this. (diagnostic_context::pedantic_errors): Rename to... (diagnostic_context::m_pedantic_errors): ...this. (diagnostic_context::permissive): Rename to... (diagnostic_context::m_permissive): ...this. (diagnostic_context::opt_permissive): Rename to... (diagnostic_context::m_opt_permissive): ...this. (diagnostic_context::fatal_errors): Rename to... (diagnostic_context::m_fatal_errors): ...this. (diagnostic_context::dc_inhibit_warnings): Rename to... (diagnostic_context::m_inhibit_warnings): ...this. (diagnostic_context::dc_warn_system_headers): Rename to... (diagnostic_context::m_warn_system_headers): ...this. (diagnostic_context::max_errors): Rename to... (diagnostic_context::m_max_errors): ...this and make private. (diagnostic_context::internal_error): Rename to... (diagnostic_context::m_internal_error): ...this. (diagnostic_context::option_enabled): Rename to... (diagnostic_context::m_option_enabled): ...this. (diagnostic_context::option_state): Rename to... (diagnostic_context::m_option_state): ...this. (diagnostic_context::option_name): Rename to... (diagnostic_context::m_option_name): ...this. (diagnostic_context::get_option_url): Rename to... (diagnostic_context::m_get_option_url): ...this. (diagnostic_context::print_path): Rename to... (diagnostic_context::m_print_path): ...this. (diagnostic_context::make_json_for_path): Rename to... (diagnostic_context::m_make_json_for_path): ...this. (diagnostic_context::x_data): Rename to... (diagnostic_context::m_client_aux_data): ...this. (diagnostic_context::last_location): Rename to... (diagnostic_context::m_last_location): ...this. (diagnostic_context::last_module): Rename to... (diagnostic_context::m_last_module): ...this and make private. (diagnostic_context::lock): Rename to... (diagnostic_context::m_lock): ...this and make private. (diagnostic_context::lang_mask): Rename to... (diagnostic_context::m_lang_mask): ...this. (diagnostic_context::inhibit_notes_p): Rename to... (diagnostic_context::m_inhibit_notes_p): ...this. (diagnostic_context::report_bug): Rename to... (diagnostic_context::m_report_bug): ...this and make private. (diagnostic_context::extra_output_kind): Rename to... (diagnostic_context::m_extra_output_kind): ...this and make private. (diagnostic_context::column_unit): Rename to... (diagnostic_context::m_column_unit): ...this and make private. (diagnostic_context::column_origin): Rename to... (diagnostic_context::m_column_origin): ...this and make private. (diagnostic_context::tabstop): Rename to... (diagnostic_context::m_tabstop): ...this and make private. (diagnostic_context::escape_format): Rename to... (diagnostic_context::m_escape_format): ...this and make private. (diagnostic_context::edit_context_ptr): Rename to... (diagnostic_context::m_edit_context_ptr): ...this and make private. (diagnostic_context::set_locations_cb): Rename to... (diagnostic_context::m_set_locations_cb): ...this and make private. (diagnostic_context::ice_handler_cb): Rename to... (diagnostic_context::m_ice_handler_cb): ...this and make private. (diagnostic_context::includes_seen): Rename to... (diagnostic_context::m_includes_seen): ...this and make private. (diagnostic_inhibit_notes): Update for field renaming. (diagnostic_context_auxiliary_data): Likewise. (diagnostic_abort_on_error): Convert from macro to inline function and update for field renaming. (diagnostic_kind_count): Convert from macro to inline function and use diagnostic_count accessor. (diagnostic_report_warnings_p): Update for field renaming. (diagnostic_initialize): Convert decl to inline function calling into diagnostic_context. (diagnostic_color_init): Likewise. (diagnostic_urls_init): Likewise. (diagnostic_urls_init): Likewise. (diagnostic_finish): Likewise. (diagnostic_report_current_module): Likewise. (diagnostic_show_any_path): Delete decl. (diagnostic_initialize_input_context): Convert decl to inline function calling into diagnostic_context. (diagnostic_classify_diagnostic): Likewise. (diagnostic_push_diagnostics): Likewise. (diagnostic_pop_diagnostics): Likewise. (diagnostic_report_diagnostic): Likewise. (diagnostic_action_after_output): Likewise. (diagnostic_check_max_errors): Likewise. (diagnostic_file_cache_fini): Delete decl. (diagnostic_converted_column): Delete decl. (warning_enabled_at): Convert decl to inline function calling into diagnostic_context. (option_unspecified_p): New. (diagnostic_emit_diagram): Delete decl. * gcc.cc: Remove include of "diagnostic-text-art.h". Update for changes to diagnostic_context. * input.cc (diagnostic_file_cache_init): Move implementation to... (diagnostic_context::file_cache_init): ...this new member function. (diagnostic_file_cache_fini): Delete. (diagnostics_file_cache_forcibly_evict_file): Update for m_file_cache becoming private. (location_get_source_line): Likewise. (get_source_file_content): Likewise. (location_missing_trailing_newline): Likewise. * input.h (diagnostics_file_cache_fini): Delete. * langhooks.cc: Update for changes to diagnostic_context. * lto-wrapper.cc: Likewise. * opts.cc: Remove include of "diagnostic-text-art.h". Update for changes to diagnostic_context. * selftest-diagnostic.cc: Update for changes to diagnostic_context. * toplev.cc: Likewise. * tree-diagnostic-path.cc: Likewise. * tree-diagnostic.cc: Likewise. gcc/ada/ChangeLog: * gcc-interface/misc.cc: Update for changes to diagnostic_context. gcc/analyzer/ChangeLog: * bounds-checking.cc: Update for changes to diagnostic_context. gcc/c-family/ChangeLog: * c-common.cc: Update for changes to diagnostic_context. * c-indentation.cc: Likewise. * c-opts.cc: Likewise. * c-warn.cc: Likewise. gcc/cp/ChangeLog: * call.cc: Update for changes to diagnostic_context. * class.cc: Likewise. * decl.cc: Likewise. * error.cc: Likewise. * except.cc: Likewise. * pt.cc: Likewise. gcc/fortran/ChangeLog: * cpp.cc: Update for changes to diagnostic_context. * error.cc: Likewise. * options.cc: Likewise. gcc/jit/ChangeLog: * jit-playback.cc: Update for changes to diagnostic_context. * jit-playback.h: Likewise. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_group_plugin.c: Update for changes to diagnostic_context. * gcc.dg/plugin/diagnostic_plugin_test_text_art.c: Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2023-10-26Daily bump.GCC Administrator1-0/+5
2023-10-25jit: dump string literal initializers correctlyVibhav Pant1-1/+1
Signed-off-by: David Malcolm <dmalcolm@redhat.com> gcc/jit/ChangeLog: * jit-recording.cc (recording::global::write_to_dump): Fix dump of string literal initializers. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2023-10-23Daily bump.GCC Administrator1-0/+4
2023-10-22Config,Darwin: Allow for configuring Darwin to use embedded runpath.Iain Sandoe1-1/+1
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.
2023-10-03Daily bump.GCC Administrator1-0/+5
2023-10-02diagnostics: add diagnostic_output_format classDavid Malcolm1-2/+2
Eliminate various global variables in the json/sarif output code by bundling together callbacks and state into a new diagnostic_output_format class, with per-output-format subclasses. No functional change intended. gcc/ChangeLog: * diagnostic-format-json.cc (toplevel_array): Remove global in favor of json_output_format::m_top_level_array. (cur_group): Likewise, for json_output_format::m_cur_group. (cur_children_array): Likewise, for json_output_format::m_cur_children_array. (class json_output_format): New. (json_begin_diagnostic): Remove, in favor of json_output_format::on_begin_diagnostic. (json_end_diagnostic): Convert to... (json_output_format::on_end_diagnostic): ...this. (json_begin_group): Remove, in favor of json_output_format::on_begin_group. (json_end_group): Remove, in favor of json_output_format::on_end_group. (json_flush_to_file): Remove, in favor of json_output_format::flush_to_file. (json_stderr_final_cb): Remove, in favor of json_output_format dtor. (json_output_base_file_name): Remove global. (class json_stderr_output_format): New. (json_file_final_cb): Remove. (class json_file_output_format): New. (json_emit_diagram): Remove. (diagnostic_output_format_init_json): Update. (diagnostic_output_format_init_json_file): Update. * diagnostic-format-sarif.cc (the_builder): Remove this global, moving to a field of the sarif_output_format. (sarif_builder::maybe_make_artifact_content_object): Use the context's m_file_cache. (get_source_lines): Convert to... (sarif_builder::get_source_lines): ...this, using context's m_file_cache. (sarif_begin_diagnostic): Remove, in favor of sarif_output_format::on_begin_diagnostic. (sarif_end_diagnostic): Remove, in favor of sarif_output_format::on_end_diagnostic. (sarif_begin_group): Remove, in favor of sarif_output_format::on_begin_group. (sarif_end_group): Remove, in favor of sarif_output_format::on_end_group. (sarif_flush_to_file): Delete. (sarif_stderr_final_cb): Delete. (sarif_output_base_file_name): Delete. (sarif_file_final_cb): Delete. (class sarif_output_format): New. (sarif_emit_diagram): Delete. (class sarif_stream_output_format): New. (class sarif_file_output_format): New. (diagnostic_output_format_init_sarif): Update. (diagnostic_output_format_init_sarif_stderr): Update. (diagnostic_output_format_init_sarif_file): Update. (diagnostic_output_format_init_sarif_stream): Update. * diagnostic-show-locus.cc (diagnostic_show_locus): Update. * diagnostic.cc (default_diagnostic_final_cb): Delete, moving to diagnostic_text_output_format's dtor. (diagnostic_initialize): Update, making a new instance of diagnostic_text_output_format. (diagnostic_finish): Delete m_output_format, rather than calling final_cb. (diagnostic_report_diagnostic): Assert that m_output_format is non-NULL. Replace call to begin_group_cb with call to m_output_format->on_begin_group. Replace call to diagnostic_starter with call to m_output_format->on_begin_diagnostic. Replace call to diagnostic_finalizer with call to m_output_format->on_end_diagnostic. (diagnostic_emit_diagram): Replace both optional call to m_diagrams.m_emission_cb and default implementation with call to m_output_format->on_diagram. Move default implementation to diagnostic_text_output_format::on_diagram. (auto_diagnostic_group::~auto_diagnostic_group): Replace call to end_group_cb with call to m_output_format->on_end_group. (diagnostic_text_output_format::~diagnostic_text_output_format): New, based on default_diagnostic_final_cb. (diagnostic_text_output_format::on_begin_diagnostic): New, based on code from diagnostic_report_diagnostic. (diagnostic_text_output_format::on_end_diagnostic): Likewise. (diagnostic_text_output_format::on_diagram): New, based on code from diagnostic_emit_diagram. * diagnostic.h (class diagnostic_output_format): New. (class diagnostic_text_output_format): New. (diagnostic_context::begin_diagnostic): Move to... (diagnostic_context::m_text_callbacks::begin_diagnostic): ...here. (diagnostic_context::start_span): Move to... (diagnostic_context::m_text_callbacks::start_span): ...here. (diagnostic_context::end_diagnostic): Move to... (diagnostic_context::m_text_callbacks::end_diagnostic): ...here. (diagnostic_context::begin_group_cb): Remove, in favor of m_output_format->on_begin_group. (diagnostic_context::end_group_cb): Remove, in favor of m_output_format->on_end_group. (diagnostic_context::final_cb): Remove, in favor of m_output_format's dtor. (diagnostic_context::m_output_format): New field. (diagnostic_context::m_diagrams.m_emission_cb): Remove, in favor of m_output_format->on_diagram. (diagnostic_starter): Update. (diagnostic_finalizer): Update. (diagnostic_output_format_init_sarif_stream): New. * input.cc (location_get_source_line): Move implementation apart from call to diagnostic_file_cache_init to... (file_cache::get_source_line): ...this new function... (location_get_source_line): ...and reintroduce, rewritten in terms of file_cache::get_source_line. (get_source_file_content): Likewise, refactor into... (file_cache::get_source_file_content): ...this new function. * input.h (file_cache::get_source_line): New decl. (file_cache::get_source_file_content): New decl. * selftest-diagnostic.cc (test_diagnostic_context::test_diagnostic_context): Update. * tree-diagnostic-path.cc (event_range::print): Update for change to diagnostic_context's start_span callback. gcc/fortran/ChangeLog: * error.cc (gfc_diagnostics_init): Update for change to start_span. gcc/jit/ChangeLog: * dummy-frontend.cc (jit_langhook_init): Update for change to diagnostic_context callbacks. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_group_plugin.c (test_begin_group_cb, test_end_group_cb): Replace with... (class test_output_format): ...this new subclass. (plugin_init): Update. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2023-09-01Daily bump.GCC Administrator1-0/+4
2023-08-31Darwin: homogenize spelling of macOSFrancois-Xavier Coudert1-1/+1
gcc/ChangeLog: * config.in: Regenerate. * config/darwin-c.cc: Change spelling to macOS. * config/darwin-driver.cc: Likewise. * config/darwin.h: Likewise. * configure.ac: Likewise. * doc/contrib.texi: Likewise. * doc/extend.texi: Likewise. * doc/invoke.texi: Likewise. * doc/plugins.texi: Likewise. * doc/tm.texi: Regenerate. * doc/tm.texi.in: Change spelling to macOS. * plugin.cc: Likewise. gcc/analyzer/ChangeLog: * kf.cc: Change spelling to macOS. gcc/c-family/ChangeLog: * c.opt: Change spelling to macOS. gcc/fortran/ChangeLog: * gfortran.texi: Likewise. gcc/jit/ChangeLog: * jit-playback.cc: Change spelling to macOS. gcc/objc/ChangeLog: * objc-act.cc: Change spelling to macOS.
2023-08-30Daily bump.GCC Administrator1-0/+16
2023-08-29libgccjit: add support for `restrict` attribute on function parametersGuillaume Gomez10-2/+136
gcc/jit/Changelog: * jit-playback.cc: Remove trailing whitespace characters. * jit-playback.h: Add get_restrict method. * jit-recording.cc: Add get_restrict methods. * jit-recording.h: Add get_restrict methods. * libgccjit++.h: Add get_restrict methods. * libgccjit.cc: Add gcc_jit_type_get_restrict. * libgccjit.h: Declare gcc_jit_type_get_restrict. * libgccjit.map: Declare gcc_jit_type_get_restrict. gcc/testsuite/ChangeLog: * jit.dg/test-restrict.c: Add test for __restrict__ attribute. * jit.dg/all-non-failing-tests.h: Add test-restrict.c to the list. gcc/jit/ChangeLog: * docs/topics/compatibility.rst: Add documentation for LIBGCCJIT_ABI_25. * docs/topics/types.rst: Add documentation for gcc_jit_type_get_restrict. Signed-off-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2023-02-17Daily bump.GCC Administrator1-0/+6
2023-02-16don't declare header-defined functions both static and inlinePatrick Palka2-9/+9
Many functions defined in our headers are declared 'static inline' which is a C idiom whose use predates our move to C++ as the implementation language. But in C++ the inline keyword is more than just a compiler hint, and is sufficient to give the function the intended semantics. In fact declaring a function both static and inline is a pessimization since static effectively disables the desired definition merging behavior enabled by inline, and is also a source of (harmless) ODR violations when a static inline function gets called from a non-static inline one (such as tree_operand_check calling tree_operand_length). This patch mechanically fixes the vast majority of occurrences of this anti-pattern throughout the compiler's headers via the command line sed -i 's/^static inline/inline/g' gcc/*.h gcc/*/*.h There's also a manual change to remove the redundant declarations of is_ivar and lookup_category in gcc/objc/objc-act.cc which would otherwise conflict with their modified definitions in objc-act.h (due to the difference in staticness). Besides fixing some ODR violations, this speeds up stage1 cc1plus by about 2% and reduces the size of its text segment by 1.5MB. gcc/ChangeLog: * addresses.h: Mechanically drop 'static' from 'static inline' functions via s/^static inline/inline/g. * asan.h: Likewise. * attribs.h: Likewise. * basic-block.h: Likewise. * bitmap.h: Likewise. * cfghooks.h: Likewise. * cfgloop.h: Likewise. * cgraph.h: Likewise. * cselib.h: Likewise. * data-streamer.h: Likewise. * debug.h: Likewise. * df.h: Likewise. * diagnostic.h: Likewise. * dominance.h: Likewise. * dumpfile.h: Likewise. * emit-rtl.h: Likewise. * except.h: Likewise. * expmed.h: Likewise. * expr.h: Likewise. * fixed-value.h: Likewise. * gengtype.h: Likewise. * gimple-expr.h: Likewise. * gimple-iterator.h: Likewise. * gimple-predict.h: Likewise. * gimple-range-fold.h: Likewise. * gimple-ssa.h: Likewise. * gimple.h: Likewise. * graphite.h: Likewise. * hard-reg-set.h: Likewise. * hash-map.h: Likewise. * hash-set.h: Likewise. * hash-table.h: Likewise. * hwint.h: Likewise. * input.h: Likewise. * insn-addr.h: Likewise. * internal-fn.h: Likewise. * ipa-fnsummary.h: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-inline.h: Likewise. * ipa-modref.h: Likewise. * ipa-prop.h: Likewise. * ira-int.h: Likewise. * ira.h: Likewise. * lra-int.h: Likewise. * lra.h: Likewise. * lto-streamer.h: Likewise. * memmodel.h: Likewise. * omp-general.h: Likewise. * optabs-query.h: Likewise. * optabs.h: Likewise. * plugin.h: Likewise. * pretty-print.h: Likewise. * range.h: Likewise. * read-md.h: Likewise. * recog.h: Likewise. * regs.h: Likewise. * rtl-iter.h: Likewise. * rtl.h: Likewise. * sbitmap.h: Likewise. * sched-int.h: Likewise. * sel-sched-ir.h: Likewise. * sese.h: Likewise. * sparseset.h: Likewise. * ssa-iterators.h: Likewise. * system.h: Likewise. * target-globals.h: Likewise. * target.h: Likewise. * timevar.h: Likewise. * tree-chrec.h: Likewise. * tree-data-ref.h: Likewise. * tree-iterator.h: Likewise. * tree-outof-ssa.h: Likewise. * tree-phinodes.h: Likewise. * tree-scalar-evolution.h: Likewise. * tree-sra.h: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-manip.h: Likewise. * tree-ssa-loop.h: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa.h: Likewise. * tree-ssanames.h: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.h: Likewise. * tree-vectorizer.h: Likewise. * tree.h: Likewise. * wide-int.h: Likewise. gcc/c-family/ChangeLog: * c-common.h: Mechanically drop static from static inline functions via s/^static inline/inline/g. gcc/c/ChangeLog: * c-parser.h: Mechanically drop static from static inline functions via s/^static inline/inline/g. gcc/cp/ChangeLog: * cp-tree.h: Mechanically drop static from static inline functions via s/^static inline/inline/g. gcc/fortran/ChangeLog: * gfortran.h: Mechanically drop static from static inline functions via s/^static inline/inline/g. gcc/jit/ChangeLog: * jit-dejagnu.h: Mechanically drop static from static inline functions via s/^static inline/inline/g. * jit-recording.h: Likewise. gcc/objc/ChangeLog: * objc-act.h: Mechanically drop static from static inline functions via s/^static inline/inline/g. * objc-map.h: Likewise. * objc-act.cc: Remove the redundant redeclarations of is_ivar and lookup_category.
2023-01-16Update copyright years.Jakub Jelinek69-110/+110
2023-01-08Daily bump.GCC Administrator1-0/+5
2023-01-07Always define `WIN32_LEAN_AND_MEAN` before <windows.h>LIU Hao1-0/+1
Recently, mingw-w64 has got updated <msxml.h> from Wine which is included indirectly by <windows.h> if `WIN32_LEAN_AND_MEAN` is not defined. The `IXMLDOMDocument` class has a member function named `abort()`, which gets affected by our `abort()` macro in "system.h". `WIN32_LEAN_AND_MEAN` should, nevertheless, always be defined. This can exclude 'APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets' [1], and speed up compilation of these files a bit. [1] https://learn.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers gcc/ PR middle-end/108300 * config/xtensa/xtensa-dynconfig.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * diagnostic-color.cc: Likewise. * plugin.cc: Likewise. * prefix.cc: Likewise. gcc/ada/ PR middle-end/108300 * adaint.c: Define `WIN32_LEAN_AND_MEAN` before `#include <windows.h>`. * cio.c: Likewise. * ctrl_c.c: Likewise. * expect.c: Likewise. * gsocket.h: Likewise. * mingw32.h: Likewise. * mkdir.c: Likewise. * rtfinal.c: Likewise. * rtinit.c: Likewise. * seh_init.c: Likewise. * sysdep.c: Likewise. * terminals.c: Likewise. * tracebak.c: Likewise. gcc/jit/ PR middle-end/108300 * jit-w32.h: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libatomic/ PR middle-end/108300 * config/mingw/lock.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libffi/ PR middle-end/108300 * src/aarch64/ffi.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libgcc/ PR middle-end/108300 * config/i386/enable-execute-stack-mingw32.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * libgcc2.c: Likewise. * unwind-generic.h: Likewise. libgfortran/ PR middle-end/108300 * intrinsics/sleep.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libgomp/ PR middle-end/108300 * config/mingw32/proc.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libiberty/ PR middle-end/108300 * make-temp-file.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * pex-win32.c: Likewise. libssp/ PR middle-end/108300 * ssp.c: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. libstdc++-v3/ PR middle-end/108300 * src/c++11/system_error.cc: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * src/c++11/thread.cc: Likewise. * src/c++17/fs_ops.cc: Likewise. * src/filesystem/ops.cc: Likewise. libvtv/ PR middle-end/108300 * vtv_malloc.cc: Define `WIN32_LEAN_AND_MEAN` before <windows.h>. * vtv_rts.cc: Likewise. * vtv_utils.cc: Likewise.
2023-01-02Update Copyright year in ChangeLog filesJakub Jelinek1-1/+1
2022 -> 2023
2022-12-22Daily bump.GCC Administrator1-0/+4
2022-12-21libgccjit: silent 2 Clang warningsMartin Liska1-2/+2
The make silent the following 2 warnings: jit/jit-playback.h:785:16: warning: private field 'm_source_file' is not used [-Wunused-private-field] jit/jit-playback.h:804:16: warning: private field 'm_line' is not used [-Wunused-private-field] gcc/jit/ChangeLog: * jit-playback.h: Use unused attribute.
2022-12-15Daily bump.GCC Administrator1-0/+6
2022-12-13libgccjit: Allow comparing vector typesAntoni Boucher1-0/+9
gcc/jit/ChangeLog: PR jit/108078 * jit-recording.h: Add vector_type::is_same_type_as method gcc/testsuite/ChangeLog: PR jit/108078 * jit.dg/test-vector-types.cc: Add tests for vector type comparison Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com> Signed-off-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-12-08Daily bump.GCC Administrator1-0/+9
2022-12-06libgccjit: Fix float vector comparisonAntoni Boucher4-8/+42
Fix float vector comparison and add comparison tests to include float and vectors. gcc/testsuite: PR jit/107770 * jit.dg/harness.h: Add new macro to to perform vector comparisons * jit.dg/test-expressions.c: Extend comparison tests to add float types and vectors gcc/jit: PR jit/107770 * jit-playback.cc: Fix vector float comparison * jit-playback.h: Update comparison function signature * jit-recording.cc: Update call for "new_comparison" function * jit-recording.h: Fix vector float comparison Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com> Signed-off-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-11-21changelog: Fix extra space after tab.Martin Liska1-4/+4
2022-11-21Daily bump.GCC Administrator1-0/+25
2022-11-19[PR other/104044] Remove extraneous semicolonsJeff Law1-1/+1
gcc/ PR other/104044 * config/mn10300/mn10300.cc (mn10300_print_operand): Remove extraneous semicolon. * config/nvptx/nvptx.cc (nvptx_goacc_reduction_fini): Likewise. gcc/jit/ PR other/104044 * jit-playback.cc (playback::lvale::mark_addressable): Remove extraeous semicolon
2022-11-19jit: Use std::mutex instead of pthread_mutex_tJonathan Wakely4-24/+29
This allows JIT to be built with a different thread model from posix where pthread isn't available By renaming the acquire_mutex () and release_mutex () member functions to lock() and unlock() we make the playback::context type meet the C++ Lockable requirements. This allows it to be used with a scoped lock (i.e. RAII) type as std::lock_guard. This automatically releases the mutex when leaving the scope. Co-authored-by: LIU Hao <lh_mouse@126.com> gcc/jit/ChangeLog: * jit-playback.cc (playback::context::scoped_lock): Define RAII lock type. (playback::context::compile): Use scoped_lock to acquire mutex for the active playback context. (jit_mutex): Change to std::mutex. (playback::context::acquire_mutex): Rename to ... (playback::context::lock): ... this. (playback::context::release_mutex): Rename to ... (playback::context::unlock): ... this. * jit-playback.h (playback::context): Rename members and declare scoped_lock. * jit-recording.cc (INCLUDE_PTHREAD_H): Remove unused define. * libgccjit.cc (version_mutex): Change to std::mutex. (struct jit_version_info): Use std::lock_guard to acquire and release mutex. gcc/ChangeLog: * system.h [INCLUDE_MUTEX]: Include header for std::mutex.
2022-11-15Daily bump.GCC Administrator1-0/+154
2022-11-14Revert "sphinx: jit: port libgccjit to shared Sphinx"Martin Liska61-57/+17067
This reverts commit 94246daa3efba88d4ae6619f24d737c01ba3dc89.
2022-11-14Revert "sphinx: add --with-sphinx-build"Martin Liska1-7/+7
This reverts commit 1f5a932e89b0c2c4a7af7f849ca2e2e3dbf329e0.
2022-11-14Revert "sphinx: fix cross manual references"Martin Liska2-3/+3
This reverts commit 72318642439703bba8c83423d4706e06444254d6.
2022-11-14Revert "sphinx: support installation if sphinx-build is missing"Martin Liska1-3/+7
This reverts commit e5821d3f62b5bf532db1be661459b7553a956fa2.
2022-11-14Revert "jit: doc: Use shared Indices and tables"Martin Liska7-36/+40
This reverts commit 3b54cc9d04c2efb2c8f9a0b515e638917636630c.
2022-11-12Daily bump.GCC Administrator1-0/+10
2022-11-11jit: doc: Use shared Indices and tablesMartin Liska7-40/+36
Apart from that, do not use leading .rst names in toctree. ChangeLog: * doc/indices-and-tables.rst: Rename Indexes to Indices. gcc/jit/ChangeLog: * doc/cp/index.rst: Remove trailing .rst in toctree. * doc/cp/intro/index.rst: Likewise. * doc/cp/topics/index.rst: Likewise. * doc/index.rst: Likewise. * doc/intro/index.rst: Likewise. * doc/topics/index.rst: Likewise. * doc/indices-and-tables.rst: New file.
2022-11-10Daily bump.GCC Administrator1-0/+129
2022-11-09sphinx: support installation if sphinx-build is missingMartin Liska1-7/+3
gcc/ChangeLog: * Makefile.in: Support installation if sphinx-build is missing. gcc/ada/ChangeLog: * gcc-interface/Make-lang.in: Support installation if sphinx-build is missing. gcc/cp/ChangeLog: * Make-lang.in: Support installation if sphinx-build is missing. gcc/d/ChangeLog: * Make-lang.in: Support installation if sphinx-build is missing. gcc/fortran/ChangeLog: * Make-lang.in: Support installation if sphinx-build is missing. gcc/go/ChangeLog: * Make-lang.in: Support installation if sphinx-build is missing. Support installation if sphinx-build is missing. gcc/jit/ChangeLog: * Make-lang.in: Support installation if sphinx-build is missing.
2022-11-09sphinx: fix cross manual referencesMartin Liska2-3/+3
gcc/ada/ChangeLog: * doc/gnat_rm/index.rst: Fix cross manual refs. gcc/ChangeLog: * doc/gcc/gcc-command-options/options-controlling-the-kind-of-output.rst: Fix cross manual refs. * doc/gcc/language-standards-supported-by-gcc/references-for-other-languages.rst: Likewise. gcc/jit/ChangeLog: * doc/internals/index.rst: Fix cross manual refs. * doc/topics/contexts.rst: Likewise.
2022-11-09sphinx: add --with-sphinx-buildMartin Liska1-7/+7
gcc/ChangeLog: * Makefile.in: Support --with-sphinx-build. * configure.ac: * configure: Regenerate. gcc/ada/ChangeLog: * gcc-interface/Make-lang.in: Support --with-sphinx-build. gcc/d/ChangeLog: * Make-lang.in: Support --with-sphinx-build. gcc/fortran/ChangeLog: * Make-lang.in: Support --with-sphinx-build. gcc/go/ChangeLog: * Make-lang.in: Support --with-sphinx-build. gcc/jit/ChangeLog: * Make-lang.in: Support --with-sphinx-build. libgomp/ChangeLog: * Makefile.in: Support --with-sphinx-build. * configure.ac: Likewise.. * configure: Regenerate. libiberty/ChangeLog: * Makefile.in: Support --with-sphinx-build. * configure.ac: Likewise. * configure: Regenerate. libitm/ChangeLog: * Makefile.in: Support --with-sphinx-build. * configure.ac: Likewise. * configure: Regenerate. libquadmath/ChangeLog: * Makefile.in: Support --with-sphinx-build. * configure.ac: Likewise. * configure: Regenerate.