aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
AgeCommit message (Collapse)AuthorFilesLines
2024-10-25ada: Add 'artificial_p' parameter to build_unc_object_typeTom Tromey3-9/+15
This adds an 'artificial_p' parameter to build_unc_object_type, so that the artificiality of the type can be propagated to create_type_decl. This will affect the namelessness of the type in a subsequent patch. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Pass artificial_p to build_unc_object_type. * gcc-interface/gigi.h (build_unc_object_type): Update. * gcc-interface/utils.cc (build_unc_object_type) Add artificial_p parameter. (build_unc_object_type_from_ptr): Update.
2024-10-25ada: Standard types are not artificialTom Tromey1-2/+14
This changes gigi so that standard types are no longer marked artificial. This change is needed to prevent subsequent patches from causing standard types to have their names elided. Also, although DWARF says that DW_AT_artificial is used for "the declaration of an object or type artificially generated by a compiler and not explicitly declared by the source program", it seems to me that types provided by the language should not be marked as such; and this is what the C and C++ compilers do. gcc/ada/ChangeLog: * gcc-interface/decl.cc (is_artificial): New function. (gnat_to_gnu_entity): Use it.
2024-10-25ada: Fix fallout of change in parameter passing out of aliasing considerationsEric Botcazou1-2/+5
If an actual parameter that is a type conversion is passed by reference but not addressable, the temporary that is created and whose address is passed instead may need to be in the target type of the conversion to fulfill the requirements of strict aliasing. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Call_to_gnu): If the formal is passed by reference and the actual is a type conversion but not addressable, create the temporary in the target type of the conversion if this is needed to enforce strict aliasing.
2024-10-25ada: Fix internal error on bit-packed array type with Volatile_Full_AccessEric Botcazou1-0/+6
The problem occurs when the component type is a record type with default values for the initialization procedure of the (base) array type, because the compiler is trying to generate a full access for a parameter of the base array type, which does not make sense. gcc/ada/ChangeLog: PR ada/116551 * gcc-interface/trans.cc (node_is_atomic) <N_Identifier>: Return false if the type of the entity is an unconstrained array type. (node_is_volatile_full_access) <N_Identifier>: Likewise.
2024-10-25ada: Back out part of previous change -- disable warningBob Duff1-1/+2
Temporarily disable the warning, because it breaks SPARK continuous builder gcc/ada/ChangeLog: * sem_ch10.adb (Analyze_With_Clause): Temporarily disable warning.
2024-10-25ada: Disable self-referential with_clausesBob Duff19-132/+152
Self-referential with_clauses (as in package body X says "with X;") cause trouble, such as duplicate nested instantiations when using container packages. This patch disables most of the processing by setting the Is_Implicit_With flag. It's not really implicit, but the subsequent processing behaves as if it is, and coming up with a more accurate (and much longer) name for the flag doesn't seem beneficial for such an obscure case. Note that the spec of X will be processed later, rather than upon seeing "with X;". Other cleanups, such as renaming Implicit_With to be Is_Implicit_With. gcc/ada/ChangeLog: * sem_ch10.adb: (Analyze_With_Clause): Check for self-referential with clause. Give a warning, and set Is_Implicit_With, which we are reusing in this obscure case even though it's not really implicit. (Analyze_Context): Remove check for self-referential with clause. It wasn't correct -- it only triggered for Acts_As_Spec subprograms. Corrected check is now in Analyze_With_Clause. (Implicit_With): Rename to be Is_Implicit_With. Misc cleanup, comment fixes. (Process_Spec_Clauses): Remove default for Exit_On_Self parameter. Use "exit when" instead of if statement. * sinfo.ads (Implicit_With): Rename to be Is_Implicit_With. Document new use for self-referential withs. * ali.adb (Scan_ALI): Use an aggregate to initialize Withs entry. * exp_put_image.adb (Preload_Root_Buffer_Type): Make this a once-only procedure. * sem_util.ads (Is_Ancestor_Package): Fix comment -- a libraryunit is an ancestor of itself, but this doesn't return True in that case. * sem_util.adb (Is_Ancestor_Package): Better to initialize things on their declaration. * lib-load.adb: Minor comment fix. * sem_prag.adb: Implicit_With --> Is_Implicit_With. Minor comment fix. * gen_il-fields.ads: Implicit_With --> Is_Implicit_With. * gen_il-gen-gen_nodes.adb: Likewise * lib.adb: Likewise * lib-writ.adb: Likewise * rtsfind.adb: Likewise * sem_cat.adb: Likewise * sem_ch12.adb: Likewise * sem_ch8.adb: Likewise * sem_elab.adb: Likewise * sem_warn.adb: Likewise * gcc-interface/trans.cc: (Implicit_With): Rename to be Is_Implicit_With.
2024-10-25ada: Emit DWARF for Ada 'with' and 'use' clausesTom Tromey1-5/+136
This changes the Ada compiler to emit DWARF information for Ada 'with' and 'use' clauses. In particular, code like: with Pck; use Pck; will be emitted as: <1><146a>: Abbrev Number: 23 (DW_TAG_module) <146b> DW_AT_name : pck <146f> DW_AT_decl_file : 1 <1470> DW_AT_decl_line : 16 <1471> DW_AT_decl_column : 6 <1><1472>: Abbrev Number: 24 (DW_TAG_imported_module) <1473> DW_AT_decl_file : 1 <1474> DW_AT_decl_line : 16 <1475> DW_AT_decl_column : 11 <1476> DW_AT_import : <0x146a> That is, DW_TAG_module is used to represent a 'with' clause, and DW_TAG_imported_module is used to represent 'use'. gcc/ada/ChangeLog: * gcc-interface/trans.cc (namespace_map): New global. (Compilation_Unit_to_gnu): Also handle N_With_Clause and N_Use_Package_Clause. (get_or_create_namespace, get_namespace): New functions. (gnat_to_gnu) <N_Package_Renaming_Declaration>: Call get_namespace. <N_Use_Package_Clause, N_With_Clause>: Likewise.
2024-10-25ada: Small adjustments to commentary after latest changeEric Botcazou1-6/+5
This removes the enumeration of the various cases in the comment associated with the declaration of In_Expanded_Body to prevent synchronization issues. gcc/ada/ChangeLog: * freeze.adb (Freeze_Expression.In_Expanded_Body): Tweak comments.
2024-10-25ada: Pragma Pre_Class and Post_Class have no effect at runtimeJavier Miranda4-86/+240
The pragmas Pre_Class and Post_Class are accepted by the compiler but have no effect at runtime. gcc/ada/ChangeLog: * freeze.adb (Freeze_Entity): If the entity is an access-to-subprogram type declaration that pre/postcondition contracts, build the wrapper (if not previously done as part of processing aspects). * sem_ch3.adb (Build_Access_Subprogram_Wrapper): Add missing support for building the wrapper when the access type has pragmas Pre_Class/Post_Class. (Build_Access_Subprogram_Wrapper_Declaration): New subprogram. * sem_ch3.ads (Build_Access_Subprogram_Wrapper): Spec moved to the public part of the package. * sem_prag.adb (Analyze_Pre_Post_Condition): Store in the tree copy of class-wide pre/postcondition expression; required to merge it with inherited conditions. (Is_Valid_Assertion_Kind): Added Pre_Class and Post_Class.
2024-10-25ada: Update GNAT UGRichard Kenner10-4714/+4787
Also add some LLVM-specific information. gcc/ada/ChangeLog: * doc/gnat_ugn/about_this_guide.rst: Numerous changes to language and style and add some LLVM-specific information. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Likewise. * doc/gnat_ugn/example_of_binder_output.rst: Likewise. * doc/gnat_ugn/getting_started_with_gnat.rst: Likewise. * doc/gnat_ugn/gnat_and_program_execution.rst: Likewise. * doc/gnat_ugn/gnat_utility_programs.rst: Likewise. * doc/gnat_ugn/inline_assembler.rst: Likewise. * doc/gnat_ugn/platform_specific_information.rst: Likewise. * doc/gnat_ugn/the_gnat_compilation_model.rst: Likewise. * gnat_ugn.texi: Regenerate.
2024-10-25ada: Fix ATC with timed delay from Ada.Real_TimeEric Botcazou1-0/+4
An Asynchronous Transfer of Control blocks with a timed delay that is computed by means of the Ada.Real_Time unit (instead of the default Ada.Calendar unit) because of a missing abort deferral in the unit. gcc/ada/ChangeLog: PR ada/43485 * libgnarl/a-retide.adb: Add with clause for System.Soft_Links. (Delay_Until): Defer and undefer abort around the call to the Timed_Delay routine of System.Task_Primitives.Operations.
2024-10-25ada: Fix internal error on function call in class-wide preconditionEric Botcazou1-0/+8
This occurs when the call is to a function that is declared in a package that is nested in the scope where the type declaration is located. gcc/ada/ChangeLog: * freeze.adb (Freeze_Expression.In_Expanded_Body): Also return True for the body of a helper/wrapper built for class-wide preconditions.
2024-10-25ada: Pragmas Pre_Class/Post_Class rejected for abstract subprogramsJavier Miranda1-9/+9
The Pre_Class/Post_Class pragmas are rejected at compile time for abstract subprograms. gcc/ada/ChangeLog: * sem_prag.adb (Analyze_Pre_Post_Condition): Allow the use of pragma Pre_Class/Post_Class with abstract subprograms.
2024-10-25ada: Spurious error when compiling in Syntax and Semantics Only modeJavier Miranda1-0/+17
Compiling under switch -gnatc, the frontend reports spurious errors accessing components of class-wide tagged types. gcc/ada/ChangeLog: * sem_ch3.adb (Record_Type_Definition): For tagged types, add the missing decoration to the First_Entity in the corresponding class-wide type entity.
2024-10-25ada: Adjust documentation of External_InitializationRonan Desplanques3-15/+3
The parameters Maximum_Size and If_Empty were mentioned during the request for comments phase but are not implemented, at least for now. This patch changes the GNAT reference manual accordingly. It also makes a minor punctuation change. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Adjust documentation. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-25ada: Update Compiler_Error documentationRichard Kenner1-1/+1
Since we usually build without assertions, we force a bugbox by raising Program_Error, not an always-false assertion. gcc/ada/ChangeLog: * comperr.ads (Compiler_Error): Update documentation.
2024-10-25ada: Add Type_Size_For function to Uintp packageEric Botcazou3-5/+20
It computes the size of an integer type that can accommodate the input. gcc/ada/ChangeLog: * uintp.ads (Type_Size_For): New function declaration. * uintp.adb (Type_Size_For): New function body. * exp_imgv.adb (Rewrite_Object_Image): Call Type_Size_For to get the size of a narrower integer type.
2024-10-25ada: Update simpler accessibility model docTonu Naks3-300/+271
gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: update simpler accessibility model * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-25ada: Misc improvements to gnat RMBob Duff3-73/+101
...in the "GNAT language extensions" section. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: Minor wording improvments. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-25ada: Increase stack size for Windows tasking programssquirek1-5/+5
This patch increases the default tasking stack size for Windows tasking program to 8 mb to avoid use of pragma Linker_Options in the general case. gcc/ada/ChangeLog: * libgnarl/s-taprop__mingw.adb: Modify stack size and update documentation.
2024-10-25ada: Constraint error not raised in ACATS test c413007Javier Miranda6-41/+79
The Constraint_Error exception is not raised when a subprogram is called using prefix notation, and the prefix of the call is an access-to-subprogram type with a null value. This new check is enabled by switch -gnatd_P gcc/ada/ChangeLog: * gen_il-fields.ads: New node field (Is_Expanded_Prefixed_Call). * gen_il-gen-gen_nodes.adb: New semantic field for N_Function_Call and N_Procedure_Call_Statement nodes. * sem_ch4.adb (Complete_Object_Operation): Mark the rewritten node with the Is_Expanded_Prefixed_Call flag. * sem_res.adb (Check_Prefixed_Call): Code cleanup and addition of documentation. (Resolve_Actuals): Add a null-exclusion check on the prefix of the call when it is an access-type. * sinfo.ads: Adding new semantic flag (Is_Expanded_Prefixed_Call) to N_Function_Call and N_Procedure_Call_Statement nodes. * debug.adb: Adding documentation for switch d_P.
2024-10-25ada: Put Finalizable aspect in -gnatXRaphaël AMIARD2-3/+4
gcc/ada/ChangeLog: * sem_ch13.adb (Analyze_One_Aspect): change the call to `Error_Msg_GNAT_Extension` to allow this aspect in core extensions. Put the code path in core extensions. * exp_util.adb (Name_Of_Controlled_Prim_Op): Put the code path in core extensions
2024-10-25ada: Fix internal error on ambiguous operands of comparison operatorEric Botcazou3-20/+58
This is a regression introduced when the diagnosis of ambiguous operands for comparison and equality operators was moved from the analysis to the resolution phase in order to avoid spurious ambiguities in specific cases. When an ambiguity is detected for the operands of predefined comparison and equality operators during analysis, it needs to be recorded so that later calls to the disambiguation routine know about this ambiguity for the case where the context has been resolved to boolean. gcc/ada/ChangeLog: * sem_type.ads (Interp ): Add Opnd_Typ component and remove default value for Abstract_Op component. (Add_One_Interp): Rename Opnd_Type parameter to Opnd_Typ. * sem_type.adb (Add_One_Interp): Likewise. (Add_One_Interp.Add_Entry): Record the operand type as well. (Collect_Interp): Record Empty for the operand type. (Disambiguate.Is_Ambiguous_Boolean_Operator): New predicate. (Disambiguate): Use it to detect recorded ambiguity cases. * sem_ch4.adb (Find_Comparison_Equality_Types): Add commentary.
2024-10-25ada: Spurious error compiling CC51011Javier Miranda1-0/+5
Adjust the check of 13.14(10.2/3) to avoid reporting an error on unfrozen incomplete types, as they are never frozen (AI12-0155-1). gcc/ada/ChangeLog: * sem_ch8.adb (Freeze_Actual_Profile): Do not report error on incomplete types, since they do not cause freezing.
2024-10-25ada: Fix wrong handling of wide wide characters in Append_Decoded_With_BracketsEric Botcazou1-1/+5
This only shows up at link time when the name of a compilation unit contains a wide wide character. gcc/ada/ChangeLog: * namet.adb (Append_Decoded_With_Brackets): Fix condition for the cheap test at the beginning of the loop.
2024-10-25ada: Fix fallout of change to 'Wide_Wide_Value for enumeration typesEric Botcazou5-6/+193
The literals of enumeration types are always normalized, even though they contain wide characters (but the normalization leaves these unchanged), so a normalization routine that is aware of wide characters must be run on the input string for 'Wide_Wide_Value. gcc/ada/ChangeLog: PR ada/115507 * rtsfind.ads (RE_Id): Add RE_Enum_[Wide_]Wide_String_To_String. (RE_Unit_Table): Add entries for the new values. * exp_attr.adb (Is_User_Defined_Enumeration_Type): New predicate. (Expand_N_Attribute_Reference) <Attribute_Wide_Value>: Build a call to RE_Enum_Wide_String_To_String for user-defined enumeration types. <Attribute_Wide_Wide_Value>: Likewise with RE_Enum_Wide_Wide_String_To_String. * exp_imgv.adb (Expand_Value_Attribute): Adjust to above. * libgnat/s-wchwts.ads (Enum_Wide_String_To_String): New function. (Enum_Wide_Wide_String_To_String): Likewise. * libgnat/s-wchwts.adb: Add clauses for System.Case_Util. (Normalize_String): New local procedure. (Enum_Wide_String_To_String): New function body. (Enum_Wide_Wide_String_To_String): Likewise.
2024-10-25ada: Untagged incomplete view not detected in ACATS test b3a1a060Javier Miranda1-5/+47
Adding checks for RM 3.10.1(10): An actual parameter cannot be of an untagged incomplete view; the result object of a function call cannot be of an incomplete view. gcc/ada/ChangeLog: * sem_res.adb (Resolve_Actuals): Add checks for incomplete type actuals.
2024-10-25ada: Forbid repr clauses for decls in handled_stmtsRaphaël AMIARD1-2/+1
gcc/ada/ChangeLog: * par-ch5.adb (P_Sequence_Of_Statements): Forbid repr clauses in handled_statements.
2024-10-25ada: Inspect deferred constant completions in missing contextsRaphaël AMIARD4-6/+19
Namely declare expressions and statement lists, which can have object declarations in -gnatX mode. gcc/ada/ChangeLog: * sem_util.ads: Introduce Inspect_Deferred_Constant_Completion on a single object declaration, to better factorize the code * sem_util.adb: Introduce aforementioned overload * sem_ch4.adb (Analyze_Expression_With_Actions): Check deferred constant completions * sem_ch5.adb (Analyze_Statements): Check deferred constant completions
2024-10-25ada: Pass parameters of full access unconstrained array types by copy in callsEric Botcazou1-5/+22
When a full access array type is declared, either Volatile_Full_Access in Ada 2012 or Atomic in Ada 2022, an implicit base array type is built by the compiler with the Full_Access flag set, although full accesses cannot be generated for objects of this type because the size is not known statically. If the component type is a record with default values, an initialization procedure taking a parameter of the base array type is built. Given that full accesses cannot be generated for the parameter inside the procedure, we need to pass the actual parameter by copy to the procedure in order to implement the full access semantics. gcc/ada/ChangeLog: * exp_ch6.adb (Expand_Actuals.Is_Legal_Copy): Return True for an initialization procedure with a full access formal parameter. (Expand_Actuals.Requires_Atomic_Or_Volatile_Copy): Return True if the formal parameter is of a full access unconstrained array type.
2024-10-24Use unique_ptr in more places in pretty_printer/diagnostics [PR116613]David Malcolm3-0/+3
My forthcoming patches for PR other/116613 make much more use of cloning of pretty_printers than before, so it makes sense as a preliminary patch for the result of pretty_printer::clone to be a std::unique_ptr, rather than add more manual uses of "delete". On doing so, I noticed various other places where naked new/delete is used for run-time configuration of diagnostics: * the output format (text vs SARIF) * client data hooks * the option manager * the URLifier Hence this patch also makes use of std::unique_ptr and ::make_unique for managing such client policy classes, and also for diagnostic_buffer's per-format implementations. Unfortunately we can't directly include <memory> in our internal headers but instead any of our TUs that make use of std::unique_ptr must #define INCLUDE_MEMORY before including system.h. Hence the bulk of this patch is taken up with adding a define of INCLUDE_MEMORY to hundreds of source files: everything that includes diagnostic.h or pretty-print.h (and thus anything transitively such as includers of lto-wrapper.h, c-tree.h, cp-tree.h and rtl-ssa.h). Thanks to Gaius Mulley for the parts of the patch that regenerated the m2 files. gcc/ada/ChangeLog: PR other/116613 * gcc-interface/misc.cc: Add #define INCLUDE_MEMORY * gcc-interface/trans.cc: Likewise. * gcc-interface/utils.cc: Likewise. gcc/analyzer/ChangeLog: PR other/116613 * analyzer-logging.cc: Add #define INCLUDE_MEMORY (logger::logger): Update for m_pp becoming a unique_ptr. (logger::~logger): Likewise. (logger::log_va_partial): Likewise. (logger::end_log_line): Likewise. * analyzer-logging.h (logger::get_printer): Likewise. (logger::m_pp): Convert to a unique_ptr. * analyzer.cc (make_label_text): Use diagnostic_context::clone_printer and use unique_ptr. (make_label_text_n): Likewise. * bar-chart.cc: Add #define INCLUDE_MEMORY * pending-diagnostic.cc (evdesc::event_desc::formatted_print): Use diagnostic_context::clone_printer and use unique_ptr. * sm-malloc.cc (sufficiently_similar_p): Likewise. * supergraph.cc (supergraph::dump_dot_to_file): Likewise. gcc/c-family/ChangeLog: PR other/116613 * c-ada-spec.cc: Add #define INCLUDE_MEMORY. * c-attribs.cc: Likewise. * c-common.cc: Likewise. * c-format.cc: Likewise. * c-gimplify.cc: Likewise. * c-indentation.cc: Likewise. * c-opts.cc: Likewise. * c-pch.cc: Likewise. * c-pragma.cc: Likewise. * c-pretty-print.cc: Likewise. Add #include "make-unique.h". (c_pretty_printer::clone): Use std::unique_ptr and ::make_unique. * c-pretty-print.h (c_pretty_printer::clone): Use std::unique_ptr. * c-type-mismatch.cc: Add #define INCLUDE_MEMORY. * c-warn.cc: Likewise. gcc/c/ChangeLog: PR other/116613 * c-aux-info.cc: Add #define INCLUDE_MEMORY. * c-convert.cc: Likewise. * c-errors.cc: Likewise. * c-fold.cc: Likewise. * c-lang.cc: Likewise. * c-objc-common.cc: Likewise. (pp_markup::element_quoted_type::print_type): Use unique_ptr. * c-typeck.cc: Add #define INCLUDE_MEMORY. * gimple-parser.cc: Likewise. gcc/cp/ChangeLog: PR other/116613 * call.cc: Add #define INCLUDE_MEMORY. * class.cc: Likewise. * constexpr.cc: Likewise. * constraint.cc: Likewise. * contracts.cc: Likewise. * coroutines.cc: Likewise. * cp-gimplify.cc: Likewise. * cp-lang.cc: Likewise. * cp-objcp-common.cc: Likewise. * cp-ubsan.cc: Likewise. * cvt.cc: Likewise. * cxx-pretty-print.cc: Likewise. Add #include "cp-tree.h". (cxx_pretty_printer::clone): Use std::unique_ptr and ::make_unique. * cxx-pretty-print.h (cxx_pretty_printer::clone): Use std::unique_ptr. * decl2.cc: Add #define INCLUDE_MEMORY. * dump.cc: Likewise. * except.cc: Likewise. * expr.cc: Likewise. * friend.cc: Likewise. * init.cc: Likewise. * lambda.cc: Likewise. * logic.cc: Likewise. * mangle.cc: Likewise. * method.cc: Likewise. * optimize.cc: Likewise. * pt.cc: Likewise. * ptree.cc: Likewise. * rtti.cc: Likewise. * search.cc: Likewise. * semantics.cc: Likewise. * tree.cc: Likewise. * typeck.cc: Likewise. * typeck2.cc: Likewise. * vtable-class-hierarchy.cc: Likewise. gcc/d/ChangeLog: PR other/116613 * d-attribs.cc: Add #define INCLUDE_MEMORY. * d-builtins.cc: Likewise. * d-codegen.cc: Likewise. * d-convert.cc: Likewise. * d-diagnostic.cc: Likewise. * d-frontend.cc: Likewise. * d-lang.cc: Likewise. * d-longdouble.cc: Likewise. * d-target.cc: Likewise. * decl.cc: Likewise. * expr.cc: Likewise. * intrinsics.cc: Likewise. * modules.cc: Likewise. * toir.cc: Likewise. * typeinfo.cc: Likewise. * types.cc: Likewise. gcc/fortran/ChangeLog: PR other/116613 * arith.cc: Add #define INCLUDE_MEMORY. * array.cc: Likewise. * bbt.cc: Likewise. * check.cc: Likewise. * class.cc: Likewise. * constructor.cc: Likewise. * convert.cc: Likewise. * cpp.cc: Likewise. * data.cc: Likewise. * decl.cc: Likewise. * dependency.cc: Likewise. * dump-parse-tree.cc: Likewise. * error.cc: Likewise. * expr.cc: Likewise. * f95-lang.cc: Likewise. * frontend-passes.cc: Likewise. * interface.cc: Likewise. * intrinsic.cc: Likewise. * io.cc: Likewise. * iresolve.cc: Likewise. * match.cc: Likewise. * matchexp.cc: Likewise. * misc.cc: Likewise. * module.cc: Likewise. * openmp.cc: Likewise. * options.cc: Likewise. * parse.cc: Likewise. * primary.cc: Likewise. * resolve.cc: Likewise. * scanner.cc: Likewise. * simplify.cc: Likewise. * st.cc: Likewise. * symbol.cc: Likewise. * target-memory.cc: Likewise. * trans-array.cc: Likewise. * trans-common.cc: Likewise. * trans-const.cc: Likewise. * trans-decl.cc: Likewise. * trans-expr.cc: Likewise. * trans-intrinsic.cc: Likewise. * trans-io.cc: Likewise. * trans-openmp.cc: Likewise. * trans-stmt.cc: Likewise. * trans-types.cc: Likewise. * trans.cc: Likewise. gcc/go/ChangeLog: PR other/116613 * go-backend.cc: Add #define INCLUDE_MEMORY. * go-lang.cc: Likewise. gcc/jit/ChangeLog: PR other/116613 * dummy-frontend.cc: Add #define INCLUDE_MEMORY. * jit-playback.cc: Likewise. * jit-recording.cc: Likewise. gcc/lto/ChangeLog: PR other/116613 * lto-common.cc: Add #define INCLUDE_MEMORY. * lto-dump.cc: Likewise. * lto-partition.cc: Likewise. * lto-symtab.cc: Likewise. * lto.cc: Likewise. gcc/m2/ChangeLog: PR other/116613 * gm2-gcc/gcc-consolidation.h: Add #define INCLUDE_MEMORY. * gm2-gcc/m2configure.cc: Likewise. * mc-boot/GASCII.cc: Regenerate. * mc-boot/GASCII.h: Ditto. * mc-boot/GArgs.cc: Ditto. * mc-boot/GArgs.h: Ditto. * mc-boot/GAssertion.cc: Ditto. * mc-boot/GAssertion.h: Ditto. * mc-boot/GBreak.cc: Ditto. * mc-boot/GBreak.h: Ditto. * mc-boot/GCOROUTINES.h: Ditto. * mc-boot/GCmdArgs.cc: Ditto. * mc-boot/GCmdArgs.h: Ditto. * mc-boot/GDebug.cc: Ditto. * mc-boot/GDebug.h: Ditto. * mc-boot/GDynamicStrings.cc: Ditto. * mc-boot/GDynamicStrings.h: Ditto. * mc-boot/GEnvironment.cc: Ditto. * mc-boot/GEnvironment.h: Ditto. * mc-boot/GFIO.cc: Ditto. * mc-boot/GFIO.h: Ditto. * mc-boot/GFormatStrings.cc: Ditto. * mc-boot/GFormatStrings.h: Ditto. * mc-boot/GFpuIO.cc: Ditto. * mc-boot/GFpuIO.h: Ditto. * mc-boot/GIO.cc: Ditto. * mc-boot/GIO.h: Ditto. * mc-boot/GIndexing.cc: Ditto. * mc-boot/GIndexing.h: Ditto. * mc-boot/GM2Dependent.cc: Ditto. * mc-boot/GM2Dependent.h: Ditto. * mc-boot/GM2EXCEPTION.cc: Ditto. * mc-boot/GM2EXCEPTION.h: Ditto. * mc-boot/GM2RTS.cc: Ditto. * mc-boot/GM2RTS.h: Ditto. * mc-boot/GMemUtils.cc: Ditto. * mc-boot/GMemUtils.h: Ditto. * mc-boot/GNumberIO.cc: Ditto. * mc-boot/GNumberIO.h: Ditto. * mc-boot/GPushBackInput.cc: Ditto. * mc-boot/GPushBackInput.h: Ditto. * mc-boot/GRTExceptions.cc: Ditto. * mc-boot/GRTExceptions.h: Ditto. * mc-boot/GRTco.h: Ditto. * mc-boot/GRTentity.h: Ditto. * mc-boot/GRTint.cc: Ditto. * mc-boot/GRTint.h: Ditto. * mc-boot/GSArgs.cc: Ditto. * mc-boot/GSArgs.h: Ditto. * mc-boot/GSFIO.cc: Ditto. * mc-boot/GSFIO.h: Ditto. * mc-boot/GSYSTEM.h: Ditto. * mc-boot/GSelective.h: Ditto. * mc-boot/GStdIO.cc: Ditto. * mc-boot/GStdIO.h: Ditto. * mc-boot/GStorage.cc: Ditto. * mc-boot/GStorage.h: Ditto. * mc-boot/GStrCase.cc: Ditto. * mc-boot/GStrCase.h: Ditto. * mc-boot/GStrIO.cc: Ditto. * mc-boot/GStrIO.h: Ditto. * mc-boot/GStrLib.cc: Ditto. * mc-boot/GStrLib.h: Ditto. * mc-boot/GStringConvert.cc: Ditto. * mc-boot/GStringConvert.h: Ditto. * mc-boot/GSysExceptions.h: Ditto. * mc-boot/GSysStorage.cc: Ditto. * mc-boot/GSysStorage.h: Ditto. * mc-boot/GTimeString.cc: Ditto. * mc-boot/GTimeString.h: Ditto. * mc-boot/GUnixArgs.h: Ditto. * mc-boot/Galists.cc: Ditto. * mc-boot/Galists.h: Ditto. * mc-boot/Gdecl.cc: Ditto. * mc-boot/Gdecl.h: Ditto. * mc-boot/Gdtoa.h: Ditto. * mc-boot/Gerrno.h: Ditto. * mc-boot/Gkeyc.cc: Ditto. * mc-boot/Gkeyc.h: Ditto. * mc-boot/Gldtoa.h: Ditto. * mc-boot/Glibc.h: Ditto. * mc-boot/Glibm.h: Ditto. * mc-boot/Glists.cc: Ditto. * mc-boot/Glists.h: Ditto. * mc-boot/GmcComment.cc: Ditto. * mc-boot/GmcComment.h: Ditto. * mc-boot/GmcComp.cc: Ditto. * mc-boot/GmcComp.h: Ditto. * mc-boot/GmcDebug.cc: Ditto. * mc-boot/GmcDebug.h: Ditto. * mc-boot/GmcError.cc: Ditto. * mc-boot/GmcError.h: Ditto. * mc-boot/GmcFileName.cc: Ditto. * mc-boot/GmcFileName.h: Ditto. * mc-boot/GmcLexBuf.cc: Ditto. * mc-boot/GmcLexBuf.h: Ditto. * mc-boot/GmcMetaError.cc: Ditto. * mc-boot/GmcMetaError.h: Ditto. * mc-boot/GmcOptions.cc: Ditto. * mc-boot/GmcOptions.h: Ditto. * mc-boot/GmcPreprocess.cc: Ditto. * mc-boot/GmcPreprocess.h: Ditto. * mc-boot/GmcPretty.cc: Ditto. * mc-boot/GmcPretty.h: Ditto. * mc-boot/GmcPrintf.cc: Ditto. * mc-boot/GmcPrintf.h: Ditto. * mc-boot/GmcQuiet.cc: Ditto. * mc-boot/GmcQuiet.h: Ditto. * mc-boot/GmcReserved.cc: Ditto. * mc-boot/GmcReserved.h: Ditto. * mc-boot/GmcSearch.cc: Ditto. * mc-boot/GmcSearch.h: Ditto. * mc-boot/GmcStack.cc: Ditto. * mc-boot/GmcStack.h: Ditto. * mc-boot/GmcStream.cc: Ditto. * mc-boot/GmcStream.h: Ditto. * mc-boot/Gmcflex.h: Ditto. * mc-boot/Gmcp1.cc: Ditto. * mc-boot/Gmcp1.h: Ditto. * mc-boot/Gmcp2.cc: Ditto. * mc-boot/Gmcp2.h: Ditto. * mc-boot/Gmcp3.cc: Ditto. * mc-boot/Gmcp3.h: Ditto. * mc-boot/Gmcp4.cc: Ditto. * mc-boot/Gmcp4.h: Ditto. * mc-boot/Gmcp5.cc: Ditto. * mc-boot/Gmcp5.h: Ditto. * mc-boot/GnameKey.cc: Ditto. * mc-boot/GnameKey.h: Ditto. * mc-boot/GsymbolKey.cc: Ditto. * mc-boot/GsymbolKey.h: Ditto. * mc-boot/Gtermios.h: Ditto. * mc-boot/Gtop.cc: Ditto. * mc-boot/Gvarargs.cc: Ditto. * mc-boot/Gvarargs.h: Ditto. * mc-boot/Gwlists.cc: Ditto. * mc-boot/Gwlists.h: Ditto. * mc-boot/Gwrapc.h: Ditto. * mc/keyc.mod (checkGccConfigSystem): Add #define INCLUDE_MEMORY. * pge-boot/GASCII.cc: Regenerate. * pge-boot/GASCII.h: Ditto. * pge-boot/GArgs.cc: Ditto. * pge-boot/GArgs.h: Ditto. * pge-boot/GAssertion.cc: Ditto. * pge-boot/GAssertion.h: Ditto. * pge-boot/GBreak.h: Ditto. * pge-boot/GCmdArgs.h: Ditto. * pge-boot/GDebug.cc: Ditto. * pge-boot/GDebug.h: Ditto. * pge-boot/GDynamicStrings.cc: Ditto. * pge-boot/GDynamicStrings.h: Ditto. * pge-boot/GEnvironment.h: Ditto. * pge-boot/GFIO.cc: Ditto. * pge-boot/GFIO.h: Ditto. * pge-boot/GFormatStrings.h: Ditto. * pge-boot/GFpuIO.h: Ditto. * pge-boot/GIO.cc: Ditto. * pge-boot/GIO.h: Ditto. * pge-boot/GIndexing.cc: Ditto. * pge-boot/GIndexing.h: Ditto. * pge-boot/GLists.cc: Ditto. * pge-boot/GLists.h: Ditto. * pge-boot/GM2Dependent.cc: Ditto. * pge-boot/GM2Dependent.h: Ditto. * pge-boot/GM2EXCEPTION.cc: Ditto. * pge-boot/GM2EXCEPTION.h: Ditto. * pge-boot/GM2RTS.cc: Ditto. * pge-boot/GM2RTS.h: Ditto. * pge-boot/GNameKey.cc: Ditto. * pge-boot/GNameKey.h: Ditto. * pge-boot/GNumberIO.cc: Ditto. * pge-boot/GNumberIO.h: Ditto. * pge-boot/GOutput.cc: Ditto. * pge-boot/GOutput.h: Ditto. * pge-boot/GPushBackInput.cc: Ditto. * pge-boot/GPushBackInput.h: Ditto. * pge-boot/GRTExceptions.cc: Ditto. * pge-boot/GRTExceptions.h: Ditto. * pge-boot/GSArgs.h: Ditto. * pge-boot/GSEnvironment.h: Ditto. * pge-boot/GSFIO.cc: Ditto. * pge-boot/GSFIO.h: Ditto. * pge-boot/GSYSTEM.h: Ditto. * pge-boot/GScan.h: Ditto. * pge-boot/GStdIO.cc: Ditto. * pge-boot/GStdIO.h: Ditto. * pge-boot/GStorage.cc: Ditto. * pge-boot/GStorage.h: Ditto. * pge-boot/GStrCase.cc: Ditto. * pge-boot/GStrCase.h: Ditto. * pge-boot/GStrIO.cc: Ditto. * pge-boot/GStrIO.h: Ditto. * pge-boot/GStrLib.cc: Ditto. * pge-boot/GStrLib.h: Ditto. * pge-boot/GStringConvert.h: Ditto. * pge-boot/GSymbolKey.cc: Ditto. * pge-boot/GSymbolKey.h: Ditto. * pge-boot/GSysExceptions.h: Ditto. * pge-boot/GSysStorage.cc: Ditto. * pge-boot/GSysStorage.h: Ditto. * pge-boot/GTimeString.h: Ditto. * pge-boot/GUnixArgs.h: Ditto. * pge-boot/Gbnflex.cc: Ditto. * pge-boot/Gbnflex.h: Ditto. * pge-boot/Gdtoa.h: Ditto. * pge-boot/Gerrno.h: Ditto. * pge-boot/Gldtoa.h: Ditto. * pge-boot/Glibc.h: Ditto. * pge-boot/Glibm.h: Ditto. * pge-boot/Gpge.cc: Ditto. * pge-boot/Gtermios.h: Ditto. * pge-boot/Gwrapc.h: Ditto. gcc/objc/ChangeLog: PR other/116613 * objc-act.cc: Add #define INCLUDE_MEMORY. * objc-encoding.cc: Likewise. * objc-gnu-runtime-abi-01.cc: Likewise. * objc-lang.cc: Likewise. * objc-next-runtime-abi-01.cc: Likewise. * objc-next-runtime-abi-02.cc: Likewise. * objc-runtime-shared-support.cc: Likewise. gcc/objcp/ChangeLog:: Add #define INCLUDE_MEMORY. PR other/116613 * objcp-decl.cc * objcp-lang.cc: Likewise. gcc/rust/ChangeLog: PR other/116613 * resolve/rust-ast-resolve-expr.cc: Add #define INCLUDE_MEMORY. * rust-attribs.cc: Likewise. * rust-system.h: Likewise. gcc/ChangeLog: PR other/116613 * asan.cc: Add #define INCLUDE_MEMORY. * attribs.cc: Likewise. (attr_access::array_as_string): Use diagnostic_context::clone_printer and use unique_ptr. * auto-profile.cc: Add #define INCLUDE_MEMORY. * calls.cc: Likewise. * cfganal.cc: Likewise. * cfgexpand.cc: Likewise. * cfghooks.cc: Likewise. * cfgloop.cc: Likewise. * cgraph.cc: Likewise. * cgraphclones.cc: Likewise. * cgraphunit.cc: Likewise. * collect-utils.cc: Likewise. * collect2.cc: Likewise. * common/config/aarch64/aarch64-common.cc: Likewise. * common/config/arm/arm-common.cc: Likewise. * common/config/avr/avr-common.cc: Likewise. * config/aarch64/aarch64-cc-fusion.cc: Likewise. * config/aarch64/aarch64-early-ra.cc: Likewise. * config/aarch64/aarch64-sve-builtins.cc: Likewise. * config/arc/arc.cc: Likewise. * config/arm/aarch-common.cc: Likewise. * config/arm/arm-mve-builtins.cc: Likewise. * config/avr/avr-devices.cc: Likewise. * config/avr/driver-avr.cc: Likewise. * config/bpf/bpf.cc: Likewise. * config/bpf/btfext-out.cc: Likewise. * config/bpf/core-builtins.cc: Likewise. * config/darwin.cc: Likewise. * config/i386/driver-i386.cc: Likewise. * config/i386/i386-builtins.cc: Likewise. * config/i386/i386-expand.cc: Likewise. * config/i386/i386-features.cc: Likewise. * config/i386/i386-options.cc: Likewise. * config/loongarch/loongarch-builtins.cc: Likewise. * config/mingw/winnt-cxx.cc: Likewise. * config/mingw/winnt.cc: Likewise. * config/mips/mips.cc: Likewise. * config/msp430/driver-msp430.cc: Likewise. * config/nvptx/mkoffload.cc: Likewise. * config/nvptx/nvptx.cc: Likewise. * config/riscv/riscv-avlprop.cc: Likewise. * config/riscv/riscv-vector-builtins.cc: Likewise. * config/riscv/riscv-vsetvl.cc: Likewise. * config/rs6000/driver-rs6000.cc: Likewise. * config/rs6000/host-darwin.cc: Likewise. * config/rs6000/rs6000-c.cc: Likewise. * config/s390/s390-c.cc: Likewise. * config/s390/s390.cc: Likewise. * config/sol2-cxx.cc: Likewise. * config/vms/vms-c.cc: Likewise. * config/xtensa/xtensa-dynconfig.cc: Likewise. * coroutine-passes.cc: Likewise. * coverage.cc: Likewise. * data-streamer-in.cc: Likewise. * data-streamer-out.cc: Likewise. * data-streamer.cc: Likewise. * diagnostic-buffer.h (diagnostic_buffer::~diagnostic_buffer): Delete. (diagnostic_buffer::m_per_format_buffer): Use std::unique_ptr. * diagnostic-client-data-hooks.h (make_compiler_data_hooks): Use std::unique_ptr for return type. * diagnostic-format-json.cc (json_output_format::make_per_format_buffer): Likewise. (diagnostic_output_format_init_json): Update for usage of std::unique_ptr in set_output_format. * diagnostic-format-sarif.cc (sarif_output_format::make_per_format_buffer): Use std::unique_ptr for return type. (diagnostic_output_format_init_sarif): Update for usage of std::unique_ptr. (test_message_with_embedded_link): Likewise for set_urlifier. * diagnostic-format-text.cc: Add #define INCLUDE_MEMORY. Include "make-unique.h". (diagnostic_text_output_format::set_buffer): Use std::unique_ptr. * diagnostic-format-text.h (diagnostic_text_output_format::set_buffer): Likewise. * diagnostic-format.h (diagnostic_output_format::make_per_format_buffer): Likewise. * diagnostic-global-context.cc: * diagnostic-macro-unwinding.cc: Likewise. * diagnostic-show-locus.cc: Likewise. * diagnostic-spec.cc: Likewise. * diagnostic.cc (diagnostic_context::set_output_format): Use std::unique_ptr for input. (diagnostic_context::set_client_data_hooks): Likewise. (diagnostic_context::set_option_manager): Likewise. (diagnostic_context::set_urlifier): Likewise. (diagnostic_context::set_diagnostic_buffer): Update for use of std::unique_ptr. (diagnostic_buffer::diagnostic_buffer): Likewise. (diagnostic_buffer::~diagnostic_buffer): Delete. * diagnostic.h: Complain if INCLUDE_MEMORY was not defined. (diagnostic_context::set_output_format): Use std::unique_ptr for input. (diagnostic_context::set_client_data_hooks): Likewise. (diagnostic_context::set_option_manager): Likewise. (diagnostic_context::set_urlifier): Likewise. (diagnostic_context::clone_printer): New. (diagnostic_context::m_printer): Update comment. (diagnostic_context::m_option_mgr): Likewise. (diagnostic_context::m_urlifier): Likewise. (diagnostic_context::m_edit_context_ptr): Likewise. (diagnostic_context::m_output_format): Likewise. (diagnostic_context::m_client_data_hooks): Likewise. (diagnostic_context::m_theme): Likewise. * digraph.cc: Add #define INCLUDE_MEMORY. * dwarf2out.cc: Likewise. * edit-context.cc: Likewise. * except.cc: Likewise. * expr.cc: Likewise. * file-prefix-map.cc: Likewise. * final.cc: Likewise. * fwprop.cc: Likewise. * gcc-plugin.h: Likewise. * gcc-rich-location.cc: Likewise. * gcc-urlifier.cc: Likewise. Add #include "make-unique.h". (make_gcc_urlifier): Use std::unique_ptr and ::make_unique. * gcc-urlifier.h (make_gcc_urlifier): Use std::unique_ptr. * gcc.cc: Add #define INCLUDE_MEMORY. Include "pretty-print-urlifier.h". * gcov-dump.cc: Add #define INCLUDE_MEMORY. * gcov-tool.cc: Likewise. * gengtype.cc (open_base_files): Likewise to output. * genmatch.cc: Likewise. * gimple-fold.cc: Likewise. * gimple-harden-conditionals.cc: Likewise. * gimple-harden-control-flow.cc: Likewise. * gimple-if-to-switch.cc: Likewise. * gimple-lower-bitint.cc: Likewise. * gimple-predicate-analysis.cc: Likewise. * gimple-pretty-print.cc: Likewise. * gimple-range-cache.cc: Likewise. * gimple-range-edge.cc: Likewise. * gimple-range-fold.cc: Likewise. * gimple-range-gori.cc: Likewise. * gimple-range-infer.cc: Likewise. * gimple-range-op.cc: Likewise. * gimple-range-path.cc: Likewise. * gimple-range-phi.cc: Likewise. * gimple-range-trace.cc: Likewise. * gimple-range.cc: Likewise. * gimple-ssa-backprop.cc: Likewise. * gimple-ssa-sprintf.cc: Likewise. * gimple-ssa-store-merging.cc: Likewise. * gimple-ssa-strength-reduction.cc: Likewise. * gimple-ssa-warn-access.cc: Likewise. * gimple-ssa-warn-alloca.cc: Likewise. * gimple-ssa-warn-restrict.cc: Likewise. * gimple-streamer-in.cc: Likewise. * gimple-streamer-out.cc: Likewise. * gimple.cc: Likewise. * gimplify.cc: Likewise. * graph.cc: Likewise. * graphviz.cc: Likewise. * input.cc: Likewise. * ipa-cp.cc: Likewise. * ipa-devirt.cc: Likewise. * ipa-fnsummary.cc: Likewise. * ipa-free-lang-data.cc: Likewise. * ipa-icf-gimple.cc: Likewise. * ipa-icf.cc: Likewise. * ipa-inline-analysis.cc: Likewise. * ipa-inline.cc: Likewise. * ipa-modref-tree.cc: Likewise. * ipa-modref.cc: Likewise. * ipa-param-manipulation.cc: Likewise. * ipa-polymorphic-call.cc: Likewise. * ipa-predicate.cc: Likewise. * ipa-profile.cc: Likewise. * ipa-prop.cc: Likewise. * ipa-pure-const.cc: Likewise. * ipa-reference.cc: Likewise. * ipa-split.cc: Likewise. * ipa-sra.cc: Likewise. * ipa-strub.cc: Likewise. * ipa-utils.cc: Likewise. * langhooks.cc: Likewise. * late-combine.cc: Likewise. * lto-cgraph.cc: Likewise. * lto-compress.cc: Likewise. * lto-opts.cc: Likewise. * lto-section-in.cc: Likewise. * lto-section-out.cc: Likewise. * lto-streamer-in.cc: Likewise. * lto-streamer-out.cc: Likewise. * lto-streamer.cc: Likewise. * lto-wrapper.cc: Likewise. Include "make-unique.h". (main): Use ::make_unique when creating option manager. * multiple_target.cc: Likewise. * omp-expand.cc: Likewise. * omp-general.cc: Likewise. * omp-low.cc: Likewise. * omp-oacc-neuter-broadcast.cc: Likewise. * omp-offload.cc: Likewise. * omp-simd-clone.cc: Likewise. * optc-gen.awk: Likewise in output. * optc-save-gen.awk: Likewise in output. * options-urls-cc-gen.awk: Likewise in output. * opts-common.cc: Likewise. * opts-global.cc: Likewise. * opts.cc: Likewise. * pair-fusion.cc: Likewise. * passes.cc: Likewise. * pointer-query.cc: Likewise. * predict.cc: Likewise. * pretty-print.cc (pretty_printer::clone): Use std::unique_ptr and ::make_unique. * pretty-print.h: Complain if INCLUDE_MEMORY is not defined. (pretty_printer::clone): Use std::unique_ptr. * print-rtl.cc: Add #define INCLUDE_MEMORY. * print-tree.cc: Likewise. * profile-count.cc: Likewise. * range-op-float.cc: Likewise. * range-op-ptr.cc: Likewise. * range-op.cc: Likewise. * range.cc: Likewise. * read-rtl-function.cc: Likewise. * rtl-error.cc: Likewise. * rtl-ssa/accesses.cc: Likewise. * rtl-ssa/blocks.cc: Likewise. * rtl-ssa/changes.cc: Likewise. * rtl-ssa/functions.cc: Likewise. * rtl-ssa/insns.cc: Likewise. * rtl-ssa/movement.cc: Likewise. * rtl-tests.cc: Likewise. * sanopt.cc: Likewise. * sched-rgn.cc: Likewise. * selftest-diagnostic-path.cc: Likewise. * selftest-diagnostic.cc: Likewise. * splay-tree-utils.cc: Likewise. * sreal.cc: Likewise. * stmt.cc: Likewise. * substring-locations.cc: Likewise. * symtab-clones.cc: Likewise. * symtab-thunks.cc: Likewise. * symtab.cc: Likewise. * text-art/box-drawing.cc: Likewise. * text-art/canvas.cc: Likewise. * text-art/ruler.cc: Likewise. * text-art/selftests.cc: Likewise. * text-art/theme.cc: Likewise. * toplev.cc: Likewise. Include "make-unique.h". (general_init): Use ::make_unique when setting option_manager. * trans-mem.cc: Add #define INCLUDE_MEMORY. * tree-affine.cc: Likewise. * tree-call-cdce.cc: Likewise. * tree-cfg.cc: Likewise. * tree-chrec.cc: Likewise. * tree-dfa.cc: Likewise. * tree-diagnostic-client-data-hooks.cc: Include "make-unique.h". (make_compiler_data_hooks): Use std::unique_ptr and ::make_unique. * tree-diagnostic.cc: Add #define INCLUDE_MEMORY. * tree-dump.cc: Likewise. * tree-inline.cc: Likewise. * tree-into-ssa.cc: Likewise. * tree-logical-location.cc: Likewise. * tree-nested.cc: Likewise. * tree-nrv.cc: Likewise. * tree-object-size.cc: Likewise. * tree-outof-ssa.cc: Likewise. * tree-pretty-print.cc: Likewise. * tree-profile.cc: Likewise. * tree-scalar-evolution.cc: Likewise. * tree-sra.cc: Likewise. * tree-ssa-address.cc: Likewise. * tree-ssa-alias.cc: Likewise. * tree-ssa-ccp.cc: Likewise. * tree-ssa-coalesce.cc: Likewise. * tree-ssa-copy.cc: Likewise. * tree-ssa-dce.cc: Likewise. * tree-ssa-dom.cc: Likewise. * tree-ssa-forwprop.cc: Likewise. * tree-ssa-ifcombine.cc: Likewise. * tree-ssa-loop-ch.cc: Likewise. * tree-ssa-loop-im.cc: Likewise. * tree-ssa-loop-manip.cc: Likewise. * tree-ssa-loop-niter.cc: Likewise. * tree-ssa-loop-split.cc: Likewise. * tree-ssa-math-opts.cc: Likewise. * tree-ssa-operands.cc: Likewise. * tree-ssa-phiprop.cc: Likewise. * tree-ssa-pre.cc: Likewise. * tree-ssa-propagate.cc: Likewise. * tree-ssa-reassoc.cc: Likewise. * tree-ssa-sccvn.cc: Likewise. * tree-ssa-scopedtables.cc: Likewise. * tree-ssa-sink.cc: Likewise. * tree-ssa-strlen.cc: Likewise. * tree-ssa-structalias.cc: Likewise. * tree-ssa-ter.cc: Likewise. * tree-ssa-uninit.cc: Likewise. * tree-ssa.cc: Likewise. * tree-ssanames.cc: Likewise. * tree-stdarg.cc: Likewise. * tree-streamer-in.cc: Likewise. * tree-streamer-out.cc: Likewise. * tree-streamer.cc: Likewise. * tree-switch-conversion.cc: Likewise. * tree-tailcall.cc: Likewise. * tree-vrp.cc: Likewise. * tree.cc: Likewise. * ubsan.cc: Likewise. * value-pointer-equiv.cc: Likewise. * value-prof.cc: Likewise. * value-query.cc: Likewise. * value-range-pretty-print.cc: Likewise. * value-range-storage.cc: Likewise. * value-range.cc: Likewise. * value-relation.cc: Likewise. * var-tracking.cc: Likewise. * varpool.cc: Likewise. * vr-values.cc: Likewise. * wide-int-print.cc: Likewise. gcc/testsuite/ChangeLog: PR other/116613 * gcc.dg/plugin/diagnostic_group_plugin.c: Update for use of std::unique_ptr. * gcc.dg/plugin/diagnostic_plugin_xhtml_format.c: Likewise. * gcc.dg/plugin/ggcplug.c: Likewise. libgcc/ChangeLog: PR other/116613 * libgcov-util.c: Add #define INCLUDE_MEMORY. Signed-off-by: David Malcolm <dmalcolm@redhat.com> Co-authored-by: Gaius Mulley <gaiusmod2@gmail.com> Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-10-12Daily bump.GCC Administrator1-0/+6
2024-10-11Fix thinko in previous changeEric Botcazou1-1/+1
gcc/ada/ PR ada/116498 PR ada/117087 * gcc-interface/decl.cc (validate_size): Fix thinko.
2024-10-10Daily bump.GCC Administrator1-0/+22
2024-10-09Fix LTO bootstrap failure with -Werror=lto-type-mismatchEric Botcazou4-14/+12
In GNAT's implementation model, using convention C (or C_Pass_By_Copy) has no effect on the internal representation of types since the representation is identical to that of C by default. It's even counter-productive given the implementation advice listed in B.3(63-71) so the interface between the front-end and gigi does not use it and instead uses structurally identical types on both sides. gcc/ada PR ada/117038 * fe.h (struct c_array): Add 'const' to declaration of pointer. (C_Source_Buffer): Use consistent formatting. * par-ch3.adb (P_Component_Items): Properly set Aliased_Present on access definition. * sinput.ads: Remove clause for Interfaces.C. (C_Array): Change type of Length to Integer and make both components aliased. Remove Convention aspect. (C_Source_Buffer): Remove all aspects. * sinput.adb (C_Source_Buffer): Adjust to above change.
2024-10-09Remove support for HP-UX 10Eric Botcazou6-2384/+0
gcc/ada * Makefile.rtl: Remove HP-UX 10 section. * libgnarl/s-osinte__hpux-dce.ads: Delete. * libgnarl/s-osinte__hpux-dce.adb: Likewise. * libgnarl/s-taprop__hpux-dce.adb: Likewise. * libgnarl/s-taspri__hpux-dce.ads: Likewise. * libgnat/s-oslock__hpux-dce.ads: Likewise.
2024-10-09Daily bump.GCC Administrator1-0/+314
2024-10-08ada: Fix infinite loop on MSP430 with -mlarge flagEric Botcazou1-7/+2
This removes the loop trying to find a pointer mode among the integer modes, which is obsolete and does not work on platforms where pointers have unusual size like MSP430 or special semantics like Morello. gcc/ada/ChangeLog: PR ada/116498 * gcc-interface/decl.cc (validate_size): Use the size of the default pointer mode as the minimum size for access types and fat pointers.
2024-10-08ada: Remove -gnateE information message for noncontiguous enumeration typeEric Botcazou1-0/+5
It is very confusing for the user because it does not make any reference to the source code but only to details of the underlying implementation. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Raise_Error_to_gnu) <CE_Invalid_Data>: Do not the generate range information if the value is a call to a Rep_To_Pos function.
2024-10-08ada: Rework the Android sigtramp implementationOlivier Hainque5-87/+115
The initial signal handling code introduced for aarch64-android overlooked details of the tasking runtime, not in the initial testing perimeter. Specifically, a reference to __gnat_sigtramp from __gnat_error_handler, initially introduced for the arm port, was prevented if !arm on the grounds that other ports would rely on kernel CFI. aarch64-android does provide kernel CFI and __gnat_sigtramp was not provided for this configuration. But there is a similar reference from s-intman__android, which kicks in as soon as the tasking runtime gets activated, triggering link failures. Testing for more precise target specific parameters from Ada code is inconvenient and replicating the logic is not attractive in any case, so this change addresses the problem in the following fashion: - Always provide a __gnat_sigtramp entry point, common to the tasking and non-tasking signal handling code for all the Android configurations, - There (C code), from target definition macros, select a path that either routes directly to the actual signal handler or goes through the intermediate layer providing hand crafted CFI information which allows unwinding up to the interrupted code. - Similarily to what was done for VxWorks, move the arm specific definitions to a separate header file to make the general structure of the common C code easier to grasp, - Adjust the comments in the common sigtramp.h header to account for such an organisation possibility. gcc/ada/ChangeLog: * sigtramp-armdroid.c: Refactor into ... * sigtramp-android.c, sigtramp-android-asm.h: New files. * Makefile.rtl (arm/aarch64-android section): Add sigtramp-android.o to EXTRA_LIBGNAT_OBJS unconditionally. Add sigtramp.h and sigtramp-android-asm.h to EXTRA_LIBGNAT_SRCS. * init.c (android section, __gnat_error_handler): Defer to __gnat_sigramp unconditionally again. * sigtramp.h: Adjust comments to allow neutral signal handling relays, merely forwarding to the underlying handler without any intermediate CFI magic.
2024-10-08ada: Fix bogus Constraint_Error for 'Wide_Wide_Value on wide enumeration literalEric Botcazou11-26/+69
The problem is that 'Wide_Wide_Value is piggybacked on 'Value and the latter invokes System.Val_Util.Normalize_String, which incorrectly normalizes the input string in the presence of enumeration literals with wide characters. gcc/ada/ChangeLog: PR ada/115507 * exp_imgv.adb (Expand_Valid_Value_Attribute): Add actual parameter for Is_Wide formal in the call to Valid_Value_Enumeration_NN. (Expand_Value_Attribute): Likewise. * libgnat/s-vaen16.ads (Value_Enumeration_16): Add Is_Wide formal. (Valid_Value_Enumeration_16): Likewise. * libgnat/s-vaen32.ads (Value_Enumeration_32): Likewise. (Valid_Value_Enumeration_32): Likewise. * libgnat/s-vaenu8.ads (Value_Enumeration_8): Likewise. (Valid_Value_Enumeration_8): Likewise. * libgnat/s-valboo.adb (Value_Boolean): Pass True for To_Upper_Case formal parameter in call to Normalize_String. * libgnat/s-valcha.adb (Value_Character): Likewise. * libgnat/s-valuen.ads (Value_Enumeration): Add Is_Wide formal. (Valid_Value_Enumeration): Likewise. * libgnat/s-valuen.adb (Value_Enumeration_Pos): Likewise and pass its negation for To_Upper_Case formal in call to Normalize_String. (Valid_Value_Enumeration): Add Is_Wide formal and forward it in call to Value_Enumeration_Pos. (Value_Enumeration): Likewise. * libgnat/s-valuti.ads (Normalize_String): Add To_Upper_Case formal parameter and adjust post-condition accordingly. * libgnat/s-valuti.adb (Normalize_String): Add To_Upper_Case formal parameter and adjust implementation accordingly. * libgnat/s-valwch.adb (Value_Wide_Wide_Character): Pass False for To_Upper_Case formal parameter in call to Normalize_String.
2024-10-08ada: Fix bogus error in instantiation with formal packageEric Botcazou1-1/+5
The compiler reports that an actual does not match the formal when there is a defaulted formal discrete type because Check_Formal_Package_Instance fails to skip the implicit base type generated by the compiler. gcc/ada/ChangeLog: PR ada/114636 * sem_ch12.adb (Check_Formal_Package_Instance): For a defaulted formal discrete type, skip the generated implicit base type.
2024-10-08ada: Fix negative value returned by 'Image for array with nonnegative componentEric Botcazou1-2/+1
The problem is that Exp_Put_Image.Build_Elementary_Put_Image_Call uses the signedness of the base type but the size of the first subtype, hence the discrepancy between them. gcc/ada/ChangeLog: PR ada/115535 * exp_put_image.adb (Build_Elementary_Put_Image_Call): Use the size of the underlying type to find the support type.
2024-10-08ada: Fix internal error on elsif part of if-statement containing if-expressionEric Botcazou1-0/+1
The problem occurs when the compiler is trying to find a context to which it can hoist finalization actions coming from the if-expression, because Find_Hook_Context incorrectly returns the N_Elsif_Part node. gcc/ada/ChangeLog: PR ada/114640 * exp_util.adb (Find_Hook_Context): For a node present within a conditional expression, do not return an N_Elsif_Part node.
2024-10-08ada: Reject mixed container aggregatesViljar Indus6-9/+75
A container aggregate can either be empty, contain only positional elements or named element associations. Reject the scenario where the latter two are both used. gcc/ada/ChangeLog: * diagnostics-constructors.adb (Make_Mixed_Container_Aggregate_Error): New function for the error message (Record_Mixed_Container_Aggregate_Error): New function for the error message. * diagnostics-constructors.ads: Likewise. * diagnostics-repository.ads: register new diagnostics id * diagnostics.ads: add new diagnostics id * errout.adb (First_And_Last_Node): Detect the span for component associations. * sem_aggr.adb (Resolve_Container_Aggregate): reject container aggregates that have both named and positional elements.
2024-10-08ada: Add mechanism to test internal error machineryRonan Desplanques3-0/+25
This patch adds a pragma that triggers an internal compiler error when analyzed. It is not externally documented and makes it possible to test the code that runs when the compiler encounters an internal error. gcc/ada/ChangeLog: * snames.ads-tmpl: Add new pragma definition. * par-prag.adb (Prag): Handle new pragma. * sem_prag.adb (Analyze_Pragma): Implement new pragma.
2024-10-08ada: Tweak position of commentRonan Desplanques1-2/+2
This patch puts a comment explaining the absence of Storage_Size in an alphabetically sorted list at the spot where Storage_Size would be in that list. gcc/ada/ChangeLog: * snames.ads-tmpl: Tweak position of comment.
2024-10-08ada: Remove references to internal gnat RFC'sTonu Naks3-210/+1897
gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: replace references to RFC's with appropriate text from the rfc * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate.
2024-10-08ada: Add dependency lines for External_InitializationRonan Desplanques2-1/+5
When a file included through External_Initialization has been modified, the unit including it must be recompiled. This patch adds the generation of dependency lines to the handling of the External_Initialization aspect, to signal that fact to gnatmake and other tools that invoke GNAT. gcc/ada/ChangeLog: * lib-writ.ads (Add_Preprocessing_Dependency): Update documentation comment. * sem_ch3.adb (Apply_External_Initialization): Add call to Add_Preprocessing_Dependency.
2024-10-08ada: Use corect capacity with two dimensional arraysViljar Indus1-207/+218
Previously when a bounded list was initialized with an array aggregate then we used the correct size only if the array was one dimensional. This patch adds support for deriving the size for multidimensional array types as well. gcc/ada/ChangeLog: * exp_aggr.adb (Build_Siz_Exp): Support deriving the size of the container aggregate with multi-dimensional arrays. Make the function return an node of an expression instead of an integer. Additionally calculate the size expression for Component_Associations. (To_Int) make this method available for more functions. (Aggregate_Size) Relocate the calculation of Componenet_Associations to Build_Siz_Exp.