aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
AgeCommit message (Collapse)AuthorFilesLines
12 daysAda: Switch from ACATS 2.6 to ACATS 4.2 testsuiteEric Botcazou1-1/+1
This effectively adds 250 new tests, i.e. around 10% more tests. gcc/ada/ * gcc-interface/Make-lang.in (ACATSDIR): Change to acats-4.
12 daysada: Fix alignment violation for chain of aligned and misaligned composite typesEric Botcazou1-1/+3
This happens when aggressive optimizations are enabled (i.e. -O2 and above) because the ivopts pass fails to properly mark the new memory accesses it is creating as misaligned by means of the build_aligned_type function. gcc/ada/ChangeLog: * gcc-interface/utils.cc (make_packable_type): Clear the TYPE_PACKED flag in the case where the alignment is bumped.
12 daysada: Remove strange elaboration code generated for Cluster type in ↵Eric Botcazou1-3/+7
System.Pack_NN Initialization procedures are turned into functions under the hood and, even when they are null (empty), the compiler may generate a convoluted sequence of instructions that return uninitialized data and, therefore, is useless. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Subprogram_Body_to_gnu): Do not generate a block-copy out for a null initialization procedure when the _Init parameter is not passed in.
12 daysada: Disable previous change for enumeration typesEric Botcazou1-3/+3
The debugger cannot correctly interpret the return value in this case. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Only apply the transformation to integer types.
12 daysada: Add missing guards to previous changeEric Botcazou1-0/+4
We need to make sure that an integer type exists for the given size. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_subprog_type): Add guards.
12 daysada: Improve code generated for return of Out parameter with access typeEric Botcazou2-4/+38
The second problem occurs on 64-bit platforms where there is a second Out parameter that is smaller than the access parameter, creating a hole in the return structure. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_subprog_type): In the case of a subprogram using the Copy-In/Copy-Out mechanism, deal specially with the case of 2 parameters of differing sizes. * gcc-interface/trans.cc (Subprogram_Body_to_gnu): In the case of a subprogram using the Copy-In/Copy-Out mechanism, make sure the types are consistent on the two sides for all the parameters.
13 daysAda: Remove left-overs of front-end exception mechanismEric Botcazou1-30/+0
It was removed from the compiler a few releases ago. gcc/ada/ * gcc-interface/Makefile.in (gnatlib-sjlj): Delete. (gnatlib-zcx): Do not modify Frontend_Exceptions constant. * libgnat/system-linux-loongarch.ads (Frontend_Exceptions): Delete.
13 daysada: Fix poor code generated for return of Out parameter with access typeEric Botcazou1-2/+3
The record type of the return object is unnecessarily given BLKmode. gcc/ada/ChangeLog: * gcc-interface/decl.cc (type_contains_only_integral_data): Do not return false only because the type contains pointer data.
13 daysada: Enforce alignment constraint for large Object_Size clausesEric Botcazou1-1/+15
The constraint is that the Object_Size must be a multiple of the alignment in bits. But it's enforced only when the value of the clause is lower than the Value_Size rounded up to the alignment in bits, not for larger values. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Use default messages for errors reported for Object_Size clauses. (validate_size): Give an error for stand-alone objects of composite types if the specified size is not a multiple of the alignment.
13 daysada: Fix alignment violation for mix of aligned and misaligned composite typesEric Botcazou1-18/+23
This happens when the chain of initialization procedures is called on the subcomponents and causes the creation of temporaries along the way out of alignment considerations. Now these temporaries are not necessary in the context and were not created until recently, so this gets rid of them. gcc/ada/ChangeLog: * gcc-interface/trans.cc (addressable_p): Add COMPG third parameter. <COMPONENT_REF>: Do not return true out of alignment considerations for non-strict-alignment targets if COMPG is set. (Call_to_gnu): Pass true as COMPG in the call to the addressable_p predicate if the called subprogram is an initialization procedure.
13 daysada: Fix wrong finalization of constrained subtype of unconstrained array typeEric Botcazou1-6/+32
This implements the Is_Constr_Array_Subt_With_Bounds flag for allocators. gcc/ada/ChangeLog: * gcc-interface/trans.cc (gnat_to_gnu) <N_Allocator>: Allocate the bounds alongside the data if the Is_Constr_Array_Subt_With_Bounds flag is set on the designated type. <N_Free_Statement>: Take into account the allocated bounds if the Is_Constr_Array_Subt_With_Bounds flag is set on the designated type.
13 daysada: Fix missing error on too large Component_Size not multiple of storage unitEric Botcazou1-5/+11
This is a small regression introduced a few years ago. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_component_type): Validate the Component_Size like the size of a type only if the component type is actually packed.
2025-07-01ada: Split the unit System.Case_Utilities into two parts.Steve Baird2-1/+3
The package System.Case_Utilities provides some subprograms that do not make use of the secondary stack and some that do. When compiling in a context where no secondary stack support is provided, this makes the entire package unusable (and similarly for any other package that withs this package). Split the package into two packages named Case_Utilities_NSS and Case_Utilities (NSS is for "no secondary stack"). The first package declares the subprograms that do not need secondary stack support. The second package declares the remaining subprograms, as well as renamings of everything declared in the first part. A client that continues to reference Case_Utilities is largely unaffected by this change. But if we change a client to reference Case_Utilities_NSS instead, that removes an obstacle that would otherwise prevent using that client unit in a no-secondary-stack-support environment. We then make that change to the body of package System.Val_Util. gcc/ada/ChangeLog: * Makefile.rtl: Add entry for new unit's object file. * libgnat/s-casuti.adb: Remove bodies of subprograms that were moved to the new unit. * libgnat/s-casuti.ads: Replace (with renamings) declarations for subprograms that moved to the new unit. * libgnat/s-cautns.adb: Body for new unit (a new source file). * libgnat/s-cautns.ads: Spec for new unit (a new source file). * libgnat/s-valuti.adb: Use the new unit instead of the old one. * gcc-interface/Make-lang.in: Add entries for new unit's object file. * gcc-interface/Makefile.in: Likewise.
2025-06-26diagnostics: make 5 more fields of diagnostic_context privateDavid Malcolm1-1/+1
No functional change intended. gcc/ada/ChangeLog: * gcc-interface/misc.cc (gnat_init): Use diagnostic_context::set_internal_error_callback. gcc/c-family/ChangeLog: * c-opts.cc (c_common_diagnostics_set_defaults): Use diagnostic_context::set_permissive_option. gcc/cp/ChangeLog: * error.cc (cxx_initialize_diagnostics): Use diagnostic_context::set_adjust_diagnostic_info_callback. gcc/ChangeLog: * diagnostic.h (diagnostic_context::set_permissive_option): New. (diagnostic_context::set_fatal_errors): New. (diagnostic_context::set_internal_error_callback): New. (diagnostic_context::set_adjust_diagnostic_info_callback): New. (diagnostic_context::inhibit_notes): New. (diagnostic_context::m_opt_permissive): Make private. (diagnostic_context::m_fatal_errors): Likewise. (diagnostic_context::m_internal_error): Likewise. (diagnostic_context::m_adjust_diagnostic_info): Likewise. (diagnostic_context::m_inhibit_notes_p): Likewise. (diagnostic_inhibit_notes): Delete. * opts.cc (common_handle_option): Use diagnostic_context::set_fatal_errors. * toplev.cc (internal_error_function): Use diagnostic_context::set_internal_error_callback. (general_init): Likewise. (process_options): Use diagnostic_context::inhibit_notes. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2025-06-23Ada: Replace hardcoded GNAT commands for GNAT toolsNicolas Boulenguez1-8/+9
This replaces the hardcoded gnat{make,link,bind,ls} commands with expansion of the GNAT{MAKE,BIND} variables computed by the configure machinery, during the build of the GNAT tools. The default GNATMAKE_FOR_HOST duplicates the default GNATMAKE, and someone setting GNATMAKE in the toplevel configuration may want it applied for all host compilations. Direct assignment of GNATMAKE_FOR_HOST keeps working. gcc/ada/ PR ada/120106 * gcc-interface/Make-lang.in: Set GNAT{MAKE,BIND,LINK_LS}_FOR_HOST from GNAT{MAKE,BIND} instead of using hardcoded commands. gnattools/ PR ada/120106 * configure.ac: Remove ACX_NONCANONICAL_HOST and add ACX_PROG_GNAT. * configure: Regenerate. * Makefile.in: Do not substitute host_noncanonical but substitute GNATMAKE and GNATBIND. Set GNAT{MAKE,BIND,LINK_LS}_FOR_HOST from GNAT{MAKE,BIND} instead of using hardcoded commands.
2025-06-23Ada: Introduce GNATMAKE_FOR_BUILD Makefile variableNicolas Boulenguez1-1/+3
This gets rid of the hardcoded 'gnatmake' command used during the build. / PR ada/120106 * Makefile.tpl: Add GNATMAKE_FOR_BUILD to {HOST,BASE_TARGET}_EXPORTS * Makefile.in: Regenerate. * configure.ac: Set the default and substitute the variable. * configure: Regenerate. gcc/ada/ PR ada/120106 * Make-generated.in: Use GNATMAKE_FOR_BUILD instead of gnatmake. * gcc-interface/Makefile.in: Likewise.
2025-06-12ada: Fix code size increase with pragma Aggregate_Individually_AssignEric Botcazou1-1/+19
The problem is that individual assignments have to preserve the other bits of the target, in other words the original semantics of aggregates, where the anonymous object is entirely constructed, is partially lost. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Generate a zero-initialization for the anonymous object of a small aggregate allocated on the stack. (inline_status_for_subprog): Minor tweak.
2025-06-06ada: Refactor the implementation of gnat diagnosticsViljar Indus2-30/+15
The goal of this patch is to remove the implementation from the Diagnostic objects and port the new features over to the Error_Msg_Objects. gcc/ada/ChangeLog: * debug.adb: Mark -gnatd_D as unused. * diagnostics-repository.adb: Move to... * errid.adb: ...here. * diagnostics-repository.ads: Move to... * errid.ads: ...here. * errout.adb (Error_Msg_Internal): Add new arguments for the new attributes of Error_Msg_Objects. (Error_Msg): Likewise. (Error_Msg_N): Likewise. (Labeled_Span): New method for creating Labeled_Span-s (Primary_Label_Span): New method for creating primary Labeled_Spans. (Secondary_Labeled_Span): New method for creating secondary Labeled_Spans. (Edit): New method for creating Edit elements. (Fix): New method for creating Fix elements. (Error_Msg_F): Simplify code for evaluating the span. (Error_Msg_FE): Likewise. (Error_Msg_NE): Likewise. (Error_Msg_NEL): Likewise. (Error_Msg_N_Gigi): New method that is used as a wrapper for the Error_Msg_xxx methods that have the new arguments. This function is later mapped to the Error_Msg method used inside gigi. (Error_Msg_NE_Gigi): Likewise. (Write_JSON_Span): Ensure that the Style prefix is included that is removed when parsing the message is reinserted to the JSON report. (Output_Messages): Use the new Pretty_Printer and Sarif_Printer packages to print the messages and remove the old implementation for the pretty printer. (Set_Msg_Text): Remove message kind insertion characters from the final message text to avoid some message kinds being duplicated. (To_Full_Span_First): New method for creating a span for a node. (To_Full_Span): Likewise. * errout.ads: Add the specs for all of the newly added functions. * diagnostics-pretty_emitter.adb: Move to... * erroutc-pretty_emitter.adb: ...here. * diagnostics-pretty_emitter.ads: Move to... * erroutc-pretty_emitter.ads: ...here. * diagnostics-sarif_emitter.adb: Move to... * erroutc-sarif_emitter.adb: ...here. * diagnostics-sarif_emitter.ads: Move to... * erroutc-sarif_emitter.ads: ...here. * erroutc.adb (Next_Error_Msg): New method for iterating to the next error message. (Next_Continuation_Msg): New method for iterating to the next continuation message. (Primary_Location): New method for returning the first primary location for the error message. (Get_Human_Id): New method for returning the human readable name for the switch associated with this error message. (Get_Doc_Switch): New method for creating the tag for the switch used in the error message. (Output_Text_Within): Change the method to operating on Strings instead of String pointers. (Output_Msg_Text): Simplify implementation for generating the error message. (Prescan_Message): Make the String handling more error proof. * erroutc.ads (Error_Msg_Object): Add new attributes that were added to Diagnostic objects to Error_Msg_Objects. Add new methods for handling the new error objects. * diagnostics-switch_repository.adb: Move to... * errsw.adb: ...here. * errutil.adb (Error_Msg): Initialize all of the new attributes added to Error_Msg_Object-s. * fe.h (Error_Msg_N): Update the binding. (Error_Msg_NE): Update the binding. For now the error_msg methods in gigi will use the old simplified interface for those methods. * diagnostics-json_utils.adb: Move to... * json_utils.adb: ...here. * diagnostics-json_utils.ads: Move to... * json_utils.ads: ...here. * par-endh.adb: Replace the old error_msg calls with the updated interface. * sem_aggr.adb: Likewise. * sem_ch13.adb: Likewise. * sem_ch4.adb: Likewise. * sem_ch9.adb: Likewise. * diagnostics-brief_emitter.adb: Removed. * diagnostics-brief_emitter.ads: Removed. * diagnostics-constructors.adb: Removed. * diagnostics-constructors.ads: Removed. * diagnostics-converter.adb: Removed. * diagnostics-converter.ads: Removed. * diagnostics-switch_repository.ads: Removed. * diagnostics-utils.adb: Removed. * diagnostics-utils.ads: Removed. * diagnostics.adb: Removed. * diagnostics.ads: Removed. * errsw.ads: New file. Based on diagnostics-switch_repository.ads. It additionally contains all the switch enumerations. * gcc-interface/Make-lang.in: Update compilation dependencies. * gcc-interface/Makefile.in: Likewise.
2025-06-05ada: Remove ghost code and SPARK annotations from runtime unitsArnaud Charlet1-5/+0
This is a clean up to facilitate maintenance now that these units have been proven. gcc/ada/ChangeLog: * exp_util.adb, rtsfind.adb, rtsfind.ads, sem_prag.adb: Remove references to RO_GH_Big_Integer and Ada_Numerics_Big_Numbers_Big_Integers_Ghost. * libgnat/a-strfix.adb, libgnat/a-strmap.adb, libgnat/a-strsea.adb, libgnat/a-strsup.adb, libgnat/i-c.ads, libgnat/i-c.adb, libgnat/s-aridou.adb, libgnat/s-aridou.ads, libgnat/s-arit128.adb, libgnat/s-arit128.ads, libgnat/s-arit32.adb, libgnat/s-arit32.ads, libgnat/s-arit64.adb, libgnat/s-arit64.ads, libgnat/s-casuti.adb, libgnat/s-exnint.ads, libgnat/s-exnlli.ads, libgnat/s-exnllli.ads, libgnat/s-expint.ads, libgnat/s-explli.ads, libgnat/s-expllli.ads, libgnat/s-explllu.ads, libgnat/s-expllu.ads, libgnat/s-expmod.adb, libgnat/s-expmod.ads, libgnat/s-exponn.adb, libgnat/s-exponn.ads, libgnat/s-expont.adb, libgnat/s-expont.ads, libgnat/s-exponu.adb, libgnat/s-exponu.ads, libgnat/s-imaged.ads, libgnat/s-imaged.adb, libgnat/s-expuns.ads, libgnat/s-imagef.ads, libgnat/s-imagef.adb, libgnat/s-imagei.adb, libgnat/s-imagei.ads, libgnat/s-imageu.adb, libgnat/s-imageu.ads, libgnat/s-imgboo.adb, libgnat/s-imde128.ads, libgnat/s-imde32.ads, libgnat/s-imde64.ads, libgnat/s-imfi128.ads, libgnat/s-imfi32.ads, libgnat/s-imfi64.ads, libgnat/s-imgboo.ads, libgnat/s-imgint.ads, libgnat/s-imglli.ads, libgnat/s-imgllli.ads, libgnat/s-imglllu.ads, libgnat/s-imgllu.ads, libgnat/s-imguns.ads, libgnat/s-valboo.adb, libgnat/s-valboo.ads, libgnat/s-valint.ads, libgnat/s-vallli.ads, libgnat/s-valllli.ads, libgnat/s-vallllu.ads, libgnat/s-valllu.ads, libgnat/s-valuns.ads, libgnat/s-valuti.adb, libgnat/s-valuti.ads, libgnat/s-valuei.adb, libgnat/s-valuei.ads, libgnat/s-valueu.ads, libgnat/s-valueu.adb, libgnat/s-veboop.adb, libgnat/s-veboop.ads, libgnat/s-widint.ads, libgnat/s-widlli.ads, libgnat/s-widllli.ads, libgnat/s-widlllu.ads, libgnat/s-widllu.ads, libgnat/s-widthi.adb, libgnat/s-widthu.adb, libgnat/s-widthu.ads, libgnat/s-widuns.ads: Remove ghost code and SPARK annotations. * libgnat/a-nbnbig.ads, libgnat/a-nbnbig.adb, libgnat/s-spark.ads, libgnat/s-spcuop.adb, libgnat/s-spcuop.ads, libgnat/s-vaispe.adb, libgnat/s-vaispe.ads, libgnat/s-vauspe.adb, libgnat/s-vauspe.ads, libgnat/s-vs_int.ads, libgnat/s-vs_lli.ads, libgnat/s-vs_llu.ads, libgnat/s-vs_uns.ads, libgnat/s-valspe.adb, libgnat/s-valspe.ads, libgnat/s-vsllli.ads, libgnat/s-vslllu.ads: Removed. * Makefile.rtl: Update list of runtime units. * gcc-interface/Make-lang.in: Remove object files.
2025-05-24Ada: move ACATS 2.6 testsuite to acats-2 directoryEric Botcazou1-1/+1
This is in preparation for the installation of the ACATS 4.2 testsuite. gcc/ada/ * gcc-interface/Make-lang.in (ACATSDIR): Use acats-2 directory. gcc/testsuite/ * ada/acats/*: Rename into ada/acats-2/*. * ada/acats-2/run_all.sh: Adjust to above renaming. * ada/acats-2/support/impdefc.a: New file.
2025-05-13Remove -q quiet option from some GNAT bootstrap command linesNicolas Boulenguez1-1/+1
gcc/ada/ PR ada/87778 * Make-generated.in: Remove -q gnatmake option. * gcc-interface/Makefile.in: Likewise.
2025-04-27Drop targetm.promote_prototypes from C, C++ and Ada frontendsH.J. Lu1-24/+0
Remove the targetm.calls.promote_prototypes call from C, C++ and Ada frontends. gcc/ PR c/48274 PR middle-end/112877 PR middle-end/118288 * gimple.cc (gimple_builtin_call_types_compatible_p): Remove the targetm.calls.promote_prototypes call. * tree.cc (tree_builtin_call_types_compatible_p): Likewise. gcc/ada/ PR middle-end/112877 * gcc-interface/utils.cc (create_param_decl): Remove the targetm.calls.promote_prototypes call. gcc/c/ PR c/48274 PR middle-end/112877 PR middle-end/118288 * c-decl.cc (start_decl): Remove the targetm.calls.promote_prototypes call. (store_parm_decls_oldstyle): Likewise. (finish_function): Likewise. * c-typeck.cc (convert_argument): Likewise. (c_safe_arg_type_equiv_p): Likewise. gcc/cp/ PR middle-end/112877 * call.cc (type_passed_as): Remove the targetm.calls.promote_prototypes call. (convert_for_arg_passing): Likewise. * typeck.cc (cxx_safe_arg_type_equiv_p): Likewise. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2025-04-07Ada: Fix wrong 'Access to aliased constrained array of controlled typeEric Botcazou2-6/+22
For technical reasons, the recently reimplemented finalization machinery for controlled types requires arrays of controlled types to be allocated with their bounds, including in the case where their nominal subtype is constrained. However, in this case, the type of 'Access for the arrays is pointer-to-constrained-array and, therefore, its value must designate the array itself and not the bounds. gcc/ada/ * gcc-interface/utils.cc (convert) <POINTER_TYPE>: Use fold_convert to convert between thin pointers. If the source is a thin pointer with zero offset from the base and the target is a pointer to its array, displace the pointer after converting it. * gcc-interface/utils2.cc (build_unary_op) <ATTR_ADDR_EXPR>: Use fold_convert to convert the address before displacing it.
2025-03-25Add support of --enable-host-pie to the native Ada compilerEric Botcazou2-39/+60
gcc/ada/ PR ada/119440 * gcc-interface/Make-lang.in (GCC_LINK): Filter out -pie in stage 1 (GCC_LLINK): Likewise. * gcc-interface/Makefile.in (COMPILER): Delete and replace by CC. (COMPILER_FLAGS): Delete. (ALL_COMPILERFLAGS): Delete and replace by ALL_CFLAGS. (ALL_ADAFLAGS): Move around. (enable_host_pie): New substituted variable. (LD_PICFLAG): Likewise. Do not add it to TOOLS_LIBS. (LIBIBERTY): Test enable_host_pie. (LIBGNAT): Likewise and use libgnat_pic.a if yes. (TOOLS_FLAGS_TO_PASS): Pass $(PICFLAG) under CFLAGS & $(LD_PICFLAG) under LDFLAGS. Also pass through ADA_CFLAGS. (common-tools): Add $(ALL_CFLAGS) $(ADA_CFLAGS) to the --GCC string of $(GNATLINK) commands. (../../gnatdll$(exeext)): Likewise. (gnatmake-re): Likewise. (gnatlink-re): Likewise. (gnatlib-shared-dual): Remove all the object files at the end. gnattools/ PR ada/119440 * configure.ac (host-pie): New switch. (host-bind-now): Likewise. Substitute PICFLAG and LD_PICFLAG. * configure: Regenerate. * Makefile.in (PICFLAG): New substituted variable. (LD_PICFLAG): Likewise. (TOOLS_FLAGS_TO_PASS): Pass $(PICFLAG) under CFLAGS & $(LD_PICFLAG) under LDFLAGS. Do not pass -I- under ADA_INCLUDES. (TOOLS_FLAGS_TO_PASS_RE): Likewise.
2025-03-19Fix misoptimization at -O2 in LTO modeEric Botcazou1-0/+8
This is a regression in recent releases. The problem is that the IPA mod/ref pass looks through the (nominal) type of a pointer-to-discriminated-type parameter in a call to a subprogram in order to see the (actual) type used for the dereferences of the parameter in the callee, which is a pointer-to-constrained-subtype. Historically the discriminated type is marked with the may_alias attribute because of the symmetric effect for the argument in the caller, so we mark the constrained subtype with the attribute now for the sake of the callee. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Record_Subtype>: Set the may_alias attribute if a specific GCC type is built.
2025-01-31Fix wrong elaboration for allocator at library level of dynamic libraryEric Botcazou1-6/+10
The problem was preexisting for class-wide allocators, but now occurs for allocators of controlled types too, because of the recent overhaul of the finalization machinery. gcc/ada/ * gcc-interface/utils.cc (gnat_pushdecl): Clear TREE_PUBLIC on functions really nested in another function.
2025-01-22d,ada/spec: only sub nostd{inc,lib} rather than nostd{inc,lib}*Arsen Arsenović1-3/+3
This prevents the gcc driver erroneously accepting -nostdlib++ when it should not when Ada was enabled. Also, similarly, -nostdinc* (where * is nonempty) is unhandled by either the Ada or D compiler, so the spec should not substitute those either (thanks for pointing that out, Jakub). Brought to my attention by Michał Górny <mgorny@gentoo.org>. gcc/ada/ChangeLog: * gcc-interface/lang-specs.h: Replace %{nostdinc*} %{nostdlib*} with %{nostdinc} %{nostdlib}. gcc/d/ChangeLog: * lang-specs.h: Replace %{nostdinc*} with %{nostdinc}. gcc/testsuite/ChangeLog: * gcc.dg/driver-nostdlibstar.c: New test.
2025-01-07Update copyright years.Marc Poulhiès19-19/+19
2025-01-07ada: Drop g-cpp* units not needed by the compilerAlexandre Oliva1-6/+0
Having moved __gnat_convert_caught_object to g-cstyin.o, we can drop other g-cpp* units that are now needed by programs that actually use their APIs to get more information about C++ exceptions and type_info objects. gcc/ada/ChangeLog: * gcc-interface/Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS): Drop g-cpp, g-cppexc and g-cppstd.
2025-01-07ada: Do not create temporaries for initialization statementsEric Botcazou1-1/+14
Assignment statements marked with the No_Ctrl_Actions or No_Finalize_Actions flag are initialization statements and, therefore, no temporaries are needed to hold the value of the right-hand side for them. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Call_to_gnu): Always use the return slot optimization if the parent node is an initialization statement. (gnat_to_gnu) <N_Assignment_Statement>: Build an INIT_EXPR instead of a MODIFY_EXPR if this is an initialization statement.
2025-01-07ada: Add "finally" GNAT extensionRonan Desplanques1-0/+23
This patch adds a new reserved word, "finally", and accompanying new syntax that's similar to the Java equivalent. gcc/ada/ChangeLog: * atree.adb (Parent_Or_List_Containing): New function. * atree.ads (Parent_Or_List_Containing): Likewise. * gen_il-fields.ads: Add new field. * gen_il-gen-gen_nodes.adb (Gen_Nodes): Extend handled sequence of statements node. * par-ch11.adb (P_Handled_Sequence_Of_Statements, P_Exception_Handler): Add new syntactic construct. * par-ch5.adb (P_Sequence_Of_Statements): Likewise. * par.adb: Likewise. * par-util.adb (Check_Future_Keyword): Warn that "finally" becomes a reserved word with extensions. * scans.adb (Initialize_Ada_Keywords): Add new reserved word. * snames.adb-tmpl: Likewise. * snames.ads-tmpl: Likewise. * scans.ads: Likewise. * sem_ch11.adb (Analyze_Handled_Statements): Adapt to new node field. * sem_ch5.adb (Analyze_Exit_Statement): Add legality check. (Analyze_Goto_Statement): Likewise. * sem_ch6.adb (Analyze_Return_Statement): Likewise. * sinfo-utils.adb (Lowest_Common_Ancestor, Destroy_Element): New subprograms. * sinfo-utils.ads (Lowest_Common_Ancestor): New function. * sinfo.ads: Add documentation for new field. * xsnamest.adb: Fix typo in comment. * doc/gnat_rm/gnat_language_extensions.rst: Document new extension. * warnsw.adb: Add new option. * warnsw.ads: Likewise. * exp_ch11.adb (Expand_N_Handled_Sequence_Of_Statements): Add abort deferral to finally part. * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. * gcc-interface/trans.cc (Handled_Sequence_Of_Statements_to_gnu): Handle finally statements.
2025-01-06Ada: fix spurious relinking of gnatbind for cross compilersEric Botcazou1-3/+7
The problem has been introduced by r15-1881. gcc/ada PR ada/118247 * gcc-interface/Make-lang.in (GNATTOOLS_CROSS_MV): Copy gnatbind instead of moving it.
2025-01-03ada: Handle C++ exception hierarchiesAlexandre Oliva1-0/+10
This patch introduces support for defining exceptions in Ada with C++'s notion of exception type compatibility, such as handling occurrences of derived types, and obtaining class-wide access to the thrown/raised objects. As a bonus, it adds support for C++ dependent (wrapped) exceptions, and introduces types and interfaces to match C++'s std::type_info and std::exception. Support for C++ exceptions with base-type matching, added to raise-gcc by calling subprograms in Ada units, requires these units and their dependencies to be linked into programs that link with raise-gcc. gcc/ada/ChangeLog: * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-cpp, g-cppstd, and g-cstyin. * doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C++): Document class-wide matching and new interfaces. * exp_prag.adb (Expand_Pragma_Import_Or_Interface): Add class-wide exception matching support with 'B' as language identifier. * libgnat/a-exexpr.adb (Setup_Current_Excep): Add Id formal. (Set_Foreign_Occurrence): Likewise. (Propagate_GCC_Exception): Adjust. (Set_Exception_Parameter): Likewise. (Unhandled_Except_Handler): Likewise. * libgnat/g-cpp.ads: New. * libgnat/g-cppexc.adb (Raise_Cpp_Exception): Match 'B' lang id. (Get_Object_Address): New. (Get_Object): Rewrite. (Get_Access_To_Object): New. (Get_Access_To_Tagged_Object): New. (Get_Type_Info): New. (Convert_Caught_Object): New. * libgnat/g-cppexc.ads (Get_Object_Address): New. (Get_Object): Note the Cpp Convention requirement. (Get_Access_To_Object): New. (Get_Access_To_Tagged_Object): New. (Get_Type_Info): New. * libgnat/g-cppstd.adb: New. * libgnat/g-cppstd.ads: New. * libgnat/g-csclex.ads: New, unused. * libgnat/g-cstyin.adb: New. * libgnat/g-cstyin.ads: New. * libgnat/g-excact.adb (Exception_Language): New. (Is_Foreign_Exception): Rewrite. * libgnat/g-excact.ads (Exception_Languages): New. (Exception_Language): New. * libgnat/s-stalib.ads (Lang): Document 'B'. * raise-gcc.c (__gnat_setup_current_excep): Add Exception_Id formal. (CXX_DEPENDENT_EXCEPTION_CLASS): New. (cxx_type_info): New. (__cxa_exception): Rename exceptionType to encompass PrimaryException. (_GNAT_Exception): Drop wrapper. (EID_For): Adjust. (exception_class_eq): Likewise. (__gnat_exception_language_is_cplusplus): New. (__gnat_exception_language_is_ada): New. (__gnat_convert_caught_object): Declare. (__gnat_get_cxx_dependent_exception): New. (__gnat_maybe_get_cxx_dependent_exception): New. (__gnat_get_cxx_exception_type_info): New. (__gnat_obtain_caught_object): New. (is_handled_by): Adjust. [!CERT] Add eid formal, handle dependent exceptions and base-type matches. (get_action_description_for) [!CERT]: Add eid formal. Adjust. (personality_body): Adjust. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS) [!STAGE1]: Add new g-cpp, g-cppstd, g-cstyin + preexisting g-cppexc and i-cstrin. * gnat-style.texi: Regenerate. * gnat_rm.texi: Regenerate.
2024-12-14opts: Use OPTION_SET_P instead of magic value 2 for -fshort-enums default ↵Jakub Jelinek1-1/+1
[PR118011] The magic values for default (usually -1 or sometimes 2) for some options are from times we haven't global_options_set, I think we should eventually get rid of all of those. The PR is about gcc -Q --help=optimizers reporting -fshort-enums as [enabled] when it is disabled. For this the following patch is just partial fix; with explicit gcc -Q --help=optimizers -fshort-enums or gcc -Q --help=optimizers -fno-short-enums it already worked correctly before, with this patch it will report even with just gcc -Q --help=optimizers correct value on most targets, except 32-bit arm with some options or defaults, so I think it is a step in the right direction. But, as I wrote in the PR, process_options isn't done before --help= and even shouldn't be in its current form where it warns on some option combinations or errors or emits sorry on others, so I think ideally process_options should have some bool argument whether it is done for --help= purposes or not, if yes, not emit warnings and just adjust the options, otherwise do what it currently does. 2024-12-14 Jakub Jelinek <jakub@redhat.com> PR c/118011 gcc/ * opts.cc (init_options_struct): Don't set opts->x_flag_short_enums to 2. * toplev.cc (process_options): Test !OPTION_SET_P (flag_short_enums) rather than flag_short_enums == 2. gcc/ada/ * gcc-interface/misc.cc (gnat_post_options): Test !OPTION_SET_P (flag_short_enums) rather than flag_short_enums == 2.
2024-12-13ada: Fix internal error on packed record with 0-size componentEric Botcazou1-1/+17
The problem is that the order of components listed in a constant CONSTRUCTOR does not match that of the associated record type. gcc/ada/ChangeLog: * gcc-interface/utils2.cc (compare_elmt_bitpos): Deal specially with 0-sized components when the bit position is the same.
2024-12-13ada: Pass artificial_p to create_type_declTom Tromey1-2/+2
The recent "nameless types" change to gcc-interface caused the gdb pretty-printer for VSS to fail. This happens because one call to create_type_decl unconditionally passes "true" as the "artificial_p" parameter. This patch changes this call to instead pass the entity's local artificial_p value instead. This makes sense, I think, because the type decl being created for debug purposes (as the comment says) is there to represent the relevant entity from the source. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Pass artificial_p to create_type_decl.
2024-11-26ada: Do not use ATTR_ADDR_EXPR for 'Unrestricted_AccessEric Botcazou1-3/+8
Unlike for 'Access or 'Unchecked_Access, the Attribute_to_gnu routine passes ATTR_ADDR_EXPR to build_unary_op for 'Unrestricted_Access, which causes the processing done in build_unary_op to flatten the reference, in particular to remove all intermediate (view) conversions, which may be problematic for the SUBSTITUTE_PLACEHOLDER_IN_EXPR machinery. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Attribute_to_gnu) <Attr_Access>: Do not pass ATTR_ADDR_EXPR to build_unary_op for 'Unrestricted_Access.
2024-11-23build: Discard obsolete references to $(GCC_PARTS)Maciej W. Rozycki1-1/+1
The $(GCC_PARTS) variable was deleted with the Makefile rework in commit fa9585134f6f ("libgcc move to the top level")[1] back in 2007, and yet the Ada and Modula 2 frontends added references to this variable later on, with commit e972fd5281b7 ("[Ada] clean ups in Makefiles")[2] back in 2011 and commit 1eee94d35177 ("Merge modula-2 front end onto gcc.") back in 2022 respectively. I guess it's because the frontends lived too long externally. Discard the references then, they serve no purpose nowadays. References: [1] <https://inbox.sourceware.org/gcc-patches/20061219191730.GA32355@nevyn.them.org/> [2] <https://inbox.sourceware.org/gcc-patches/20110906151510.GA5213@adacore.com/> gcc/ada/ * gcc-interface/Make-lang.in (gnattools): Remove $(GCC_PARTS). gcc/m2/ * Make-lang.in (m2 modula-2 modula2): Remove $(GCC_PARTS).
2024-11-22build: Remove INCLUDE_MEMORY [PR117737]Andrew Pinski3-3/+0
Since diagnostic.h is included in over half of the sources, requiring to `#define INCLUDE_MEMORY` does not make sense. Instead lets unconditionally include memory in system.h. The majority of this patch is just removing `#define INCLUDE_MEMORY` from the sources which currently have it. This should also fix the mingw build issue but I have not tried it. Bootstrapped and tested on x86_64-linux-gnu. PR bootstrap/117737 gcc/ada/ChangeLog: * gcc-interface/misc.cc (INCLUDE_MEMORY): Remove. * gcc-interface/trans.cc (INCLUDE_MEMORY): Remove. * gcc-interface/utils.cc (INCLUDE_MEMORY): Remove. gcc/analyzer/ChangeLog: * access-diagram.cc (INCLUDE_MEMORY): Remove. * analysis-plan.cc (INCLUDE_MEMORY): Remove. * analyzer-language.cc (INCLUDE_MEMORY): Remove. * analyzer-logging.cc (INCLUDE_MEMORY): Remove. * analyzer-pass.cc (INCLUDE_MEMORY): Remove. * analyzer-selftests.cc (INCLUDE_MEMORY): Remove. * analyzer.cc (INCLUDE_MEMORY): Remove. * bar-chart.cc (INCLUDE_MEMORY): Remove. * bounds-checking.cc (INCLUDE_MEMORY): Remove. * call-details.cc (INCLUDE_MEMORY): Remove. * call-info.cc (INCLUDE_MEMORY): Remove. * call-string.cc (INCLUDE_MEMORY): Remove. * call-summary.cc (INCLUDE_MEMORY): Remove. * checker-event.cc (INCLUDE_MEMORY): Remove. * checker-path.cc (INCLUDE_MEMORY): Remove. * complexity.cc (INCLUDE_MEMORY): Remove. * constraint-manager.cc (INCLUDE_MEMORY): Remove. * diagnostic-manager.cc (INCLUDE_MEMORY): Remove. * engine.cc (INCLUDE_MEMORY): Remove. * feasible-graph.cc (INCLUDE_MEMORY): Remove. * infinite-loop.cc (INCLUDE_MEMORY): Remove. * infinite-recursion.cc (INCLUDE_MEMORY): Remove. * kf-analyzer.cc (INCLUDE_MEMORY): Remove. * kf-lang-cp.cc (INCLUDE_MEMORY): Remove. * kf.cc (INCLUDE_MEMORY): Remove. * known-function-manager.cc (INCLUDE_MEMORY): Remove. * pending-diagnostic.cc (INCLUDE_MEMORY): Remove. * program-point.cc (INCLUDE_MEMORY): Remove. * program-state.cc (INCLUDE_MEMORY): Remove. * ranges.cc (INCLUDE_MEMORY): Remove. * record-layout.cc (INCLUDE_MEMORY): Remove. * region-model-asm.cc (INCLUDE_MEMORY): Remove. * region-model-manager.cc (INCLUDE_MEMORY): Remove. * region-model-reachability.cc (INCLUDE_MEMORY): Remove. * region-model.cc (INCLUDE_MEMORY): Remove. * region.cc (INCLUDE_MEMORY): Remove. * sm-fd.cc (INCLUDE_MEMORY): Remove. * sm-file.cc (INCLUDE_MEMORY): Remove. * sm-malloc.cc (INCLUDE_MEMORY): Remove. * sm-pattern-test.cc (INCLUDE_MEMORY): Remove. * sm-sensitive.cc (INCLUDE_MEMORY): Remove. * sm-signal.cc (INCLUDE_MEMORY): Remove. * sm-taint.cc (INCLUDE_MEMORY): Remove. * sm.cc (INCLUDE_MEMORY): Remove. * state-purge.cc (INCLUDE_MEMORY): Remove. * store.cc (INCLUDE_MEMORY): Remove. * supergraph.cc (INCLUDE_MEMORY): Remove. * svalue.cc (INCLUDE_MEMORY): Remove. * symbol.cc (INCLUDE_MEMORY): Remove. * trimmed-graph.cc (INCLUDE_MEMORY): Remove. * varargs.cc (INCLUDE_MEMORY): Remove. gcc/ChangeLog: * asan.cc (INCLUDE_MEMORY): Remove. * attribs.cc (INCLUDE_MEMORY): Remove. * auto-profile.cc (INCLUDE_MEMORY): Remove. * calls.cc (INCLUDE_MEMORY): Remove. * cfganal.cc (INCLUDE_MEMORY): Remove. * cfgexpand.cc (INCLUDE_MEMORY): Remove. * cfghooks.cc (INCLUDE_MEMORY): Remove. * cfgloop.cc (INCLUDE_MEMORY): Remove. * cgraph.cc (INCLUDE_MEMORY): Remove. * cgraphclones.cc (INCLUDE_MEMORY): Remove. * cgraphunit.cc (INCLUDE_MEMORY): Remove. * collect-utils.cc (INCLUDE_MEMORY): Remove. * collect2.cc (INCLUDE_MEMORY): Remove. * common/config/aarch64/aarch64-common.cc (INCLUDE_MEMORY): Remove. * common/config/arm/arm-common.cc (INCLUDE_MEMORY): Remove. * common/config/avr/avr-common.cc (INCLUDE_MEMORY): Remove. * config/aarch64/aarch64-cc-fusion.cc (INCLUDE_MEMORY): Remove. * config/aarch64/aarch64-early-ra.cc (INCLUDE_MEMORY): Remove. * config/aarch64/aarch64-sve-builtins.cc (INCLUDE_MEMORY): Remove. * config/aarch64/aarch64.cc (INCLUDE_MEMORY): Remove. * config/arc/arc.cc (INCLUDE_MEMORY): Remove. * config/arm/aarch-common.cc (INCLUDE_MEMORY) Remove.: * config/arm/arm-mve-builtins.cc (INCLUDE_MEMORY): Remove. * config/arm/arm.cc (INCLUDE_MEMORY): Remove. * config/avr/avr-devices.cc (INCLUDE_MEMORY): Remove. * config/avr/driver-avr.cc (INCLUDE_MEMORY): Remove. * config/bpf/bpf.cc (INCLUDE_MEMORY): Remove. * config/bpf/btfext-out.cc (INCLUDE_MEMORY): Remove. * config/bpf/core-builtins.cc (INCLUDE_MEMORY): Remove. * config/darwin.cc (INCLUDE_MEMORY): Remove. * config/gcn/mkoffload.cc (INCLUDE_MEMORY): Remove. * config/i386/driver-i386.cc (INCLUDE_MEMORY): Remove. * config/i386/i386-builtins.cc (INCLUDE_MEMORY): Remove. * config/i386/i386-expand.cc (INCLUDE_MEMORY): Remove. * config/i386/i386-features.cc (INCLUDE_MEMORY): Remove. * config/i386/i386-options.cc (INCLUDE_MEMORY): Remove. * config/i386/i386.cc (INCLUDE_MEMORY): Remove. * config/loongarch/loongarch-builtins.cc (INCLUDE_MEMORY): Remove. * config/loongarch/loongarch.cc (INCLUDE_MEMORY): Remove. * config/mingw/winnt-cxx.cc (INCLUDE_MEMORY): Remove. * config/mingw/winnt.cc (INCLUDE_MEMORY): Remove. * config/mips/mips.cc (INCLUDE_MEMORY): Remove. * config/msp430/driver-msp430.cc (INCLUDE_MEMORY): Remove. * config/nvptx/mkoffload.cc (INCLUDE_MEMORY): Remove. * config/nvptx/nvptx.cc (INCLUDE_MEMORY): Remove. * config/riscv/riscv-avlprop.cc (INCLUDE_MEMORY): Remove. * config/riscv/riscv-target-attr.cc (INCLUDE_MEMORY): Remove. * config/riscv/riscv-vector-builtins.cc (INCLUDE_MEMORY): Remove. * config/riscv/riscv-vector-costs.cc (INCLUDE_MEMORY): Remove. * config/riscv/riscv-vsetvl.cc (INCLUDE_MEMORY): Remove. * config/riscv/riscv.cc (INCLUDE_MEMORY): Remove. * config/rs6000/driver-rs6000.cc (INCLUDE_MEMORY): Remove. * config/rs6000/host-darwin.cc (INCLUDE_MEMORY): Remove. * config/rs6000/rs6000-c.cc (INCLUDE_MEMORY): Remove. * config/rs6000/rs6000.cc (INCLUDE_MEMORY): Remove. * config/s390/s390-c.cc (INCLUDE_MEMORY): Remove. * config/s390/s390.cc (INCLUDE_MEMORY): Remove. * config/sol2-cxx.cc (INCLUDE_MEMORY): Remove. * config/vms/vms-c.cc (INCLUDE_MEMORY): Remove. * config/xtensa/xtensa-dynconfig.cc (INCLUDE_MEMORY): Remove. * coroutine-passes.cc (INCLUDE_MEMORY): Remove. * coverage.cc (INCLUDE_MEMORY): Remove. * data-streamer-in.cc (INCLUDE_MEMORY): Remove. * data-streamer-out.cc (INCLUDE_MEMORY): Remove. * data-streamer.cc (INCLUDE_MEMORY): Remove. * diagnostic-format-json.cc (INCLUDE_MEMORY): Remove. * diagnostic-format-sarif.cc (INCLUDE_MEMORY): Remove. * diagnostic-format-text.cc (INCLUDE_MEMORY): Remove. * diagnostic-global-context.cc (INCLUDE_MEMORY): Remove. * diagnostic-macro-unwinding.cc (INCLUDE_MEMORY): Remove. * diagnostic-path.cc (INCLUDE_MEMORY): Remove. * diagnostic-show-locus.cc (INCLUDE_MEMORY): Remove. * diagnostic-spec.cc (INCLUDE_MEMORY): Remove. * diagnostic.cc (INCLUDE_MEMORY): Remove. * diagnostic.h: Remove check for INCLUDE_MEMORY. * digraph.cc (INCLUDE_MEMORY): Remove. * dumpfile.cc (INCLUDE_MEMORY): Remove. * dwarf2out.cc (INCLUDE_MEMORY): Remove. * edit-context.cc (INCLUDE_MEMORY): Remove. * except.cc (INCLUDE_MEMORY): Remove. * expr.cc (INCLUDE_MEMORY): Remove. * file-prefix-map.cc (INCLUDE_MEMORY): Remove. * final.cc (INCLUDE_MEMORY): Remove. * fwprop.cc (INCLUDE_MEMORY): Remove. * gcc-plugin.h (INCLUDE_MEMORY): Remove. * gcc-rich-location.cc (INCLUDE_MEMORY): Remove. * gcc-urlifier.cc (INCLUDE_MEMORY): Remove. * gcc.cc (INCLUDE_MEMORY): Remove. * gcov-dump.cc (INCLUDE_MEMORY): Remove. * gcov-tool.cc (INCLUDE_MEMORY): Remove. * gcov.cc (INCLUDE_MEMORY): Remove. * gengtype.cc (open_base_files): Don't print `#define INCLUDE_MEMORY`. * genmatch.cc (INCLUDE_MEMORY): Remove. * gimple-fold.cc (INCLUDE_MEMORY): Remove. * gimple-harden-conditionals.cc (INCLUDE_MEMORY): Remove. * gimple-harden-control-flow.cc (INCLUDE_MEMORY): Remove. * gimple-if-to-switch.cc (INCLUDE_MEMORY): Remove. * gimple-loop-interchange.cc (INCLUDE_MEMORY): Remove. * gimple-loop-jam.cc (INCLUDE_MEMORY): Remove. * gimple-loop-versioning.cc (INCLUDE_MEMORY): Remove. * gimple-lower-bitint.cc (INCLUDE_MEMORY): Remove. * gimple-predicate-analysis.cc (INCLUDE_MEMORY): Remove. * gimple-pretty-print.cc (INCLUDE_MEMORY): Remove. * gimple-range-cache.cc (INCLUDE_MEMORY): Remove. * gimple-range-edge.cc (INCLUDE_MEMORY): Remove. * gimple-range-fold.cc (INCLUDE_MEMORY): Remove. * gimple-range-gori.cc (INCLUDE_MEMORY): Remove. * gimple-range-infer.cc (INCLUDE_MEMORY): Remove. * gimple-range-op.cc (INCLUDE_MEMORY): Remove. * gimple-range-path.cc (INCLUDE_MEMORY): Remove. * gimple-range-phi.cc (INCLUDE_MEMORY): Remove. * gimple-range-trace.cc (INCLUDE_MEMORY): Remove. * gimple-range.cc (INCLUDE_MEMORY): Remove. * gimple-ssa-backprop.cc (INCLUDE_MEMORY): Remove. * gimple-ssa-sprintf.cc (INCLUDE_MEMORY): Remove. * gimple-ssa-store-merging.cc (INCLUDE_MEMORY): Remove. * gimple-ssa-strength-reduction.cc (INCLUDE_MEMORY): Remove. * gimple-ssa-warn-access.cc (INCLUDE_MEMORY): Remove. * gimple-ssa-warn-alloca.cc (INCLUDE_MEMORY): Remove. * gimple-ssa-warn-restrict.cc (INCLUDE_MEMORY): Remove. * gimple-streamer-in.cc (INCLUDE_MEMORY): Remove. * gimple-streamer-out.cc (INCLUDE_MEMORY): Remove. * gimple.cc (INCLUDE_MEMORY): Remove. * gimplify.cc (INCLUDE_MEMORY): Remove. * graph.cc (INCLUDE_MEMORY): Remove. * graphite-dependences.cc (INCLUDE_MEMORY): Remove. * graphite-isl-ast-to-gimple.cc (INCLUDE_MEMORY): Remove. * graphite-optimize-isl.cc (INCLUDE_MEMORY): Remove. * graphite-poly.cc (INCLUDE_MEMORY): Remove. * graphite-scop-detection.cc (INCLUDE_MEMORY): Remove. * graphite-sese-to-poly.cc (INCLUDE_MEMORY): Remove. * graphite.cc (INCLUDE_MEMORY): Remove. * graphviz.cc (INCLUDE_MEMORY): Remove. * input.cc (INCLUDE_MEMORY): Remove. * ipa-cp.cc (INCLUDE_MEMORY): Remove. * ipa-devirt.cc (INCLUDE_MEMORY): Remove. * ipa-fnsummary.cc (INCLUDE_MEMORY): Remove. * ipa-free-lang-data.cc (INCLUDE_MEMORY): Remove. * ipa-icf-gimple.cc (INCLUDE_MEMORY): Remove. * ipa-icf.cc (INCLUDE_MEMORY): Remove. * ipa-inline-analysis.cc (INCLUDE_MEMORY): Remove. * ipa-inline.cc (INCLUDE_MEMORY): Remove. * ipa-modref-tree.cc (INCLUDE_MEMORY): Remove. * ipa-modref.cc (INCLUDE_MEMORY): Remove. * ipa-param-manipulation.cc (INCLUDE_MEMORY): Remove. * ipa-polymorphic-call.cc (INCLUDE_MEMORY): Remove. * ipa-predicate.cc (INCLUDE_MEMORY): Remove. * ipa-profile.cc (INCLUDE_MEMORY): Remove. * ipa-prop.cc (INCLUDE_MEMORY): Remove. * ipa-pure-const.cc (INCLUDE_MEMORY): Remove. * ipa-reference.cc (INCLUDE_MEMORY): Remove. * ipa-split.cc (INCLUDE_MEMORY): Remove. * ipa-sra.cc (INCLUDE_MEMORY): Remove. * ipa-strub.cc (INCLUDE_MEMORY): Remove. * ipa-utils.cc (INCLUDE_MEMORY): Remove. * json-parsing.cc (INCLUDE_MEMORY): Remove. * json.cc (INCLUDE_MEMORY): Remove. * json.h: Don't check INCLUDE_MEMORY. * langhooks.cc (INCLUDE_MEMORY): Remove. * late-combine.cc (INCLUDE_MEMORY): Remove. * lazy-diagnostic-path.cc (INCLUDE_MEMORY): Remove. * libdiagnostics.cc (INCLUDE_MEMORY): Remove. * libsarifreplay.cc (INCLUDE_MEMORY): Remove. * lto-cgraph.cc (INCLUDE_MEMORY): Remove. * lto-compress.cc (INCLUDE_MEMORY): Remove. * lto-opts.cc (INCLUDE_MEMORY): Remove. * lto-section-in.cc (INCLUDE_MEMORY): Remove. * lto-section-out.cc (INCLUDE_MEMORY): Remove. * lto-streamer-in.cc (INCLUDE_MEMORY): Remove. * lto-streamer-out.cc (INCLUDE_MEMORY): Remove. * lto-streamer.cc (INCLUDE_MEMORY): Remove. * lto-wrapper.cc (INCLUDE_MEMORY): Remove. * make-unique.h (GCC_MAKE_UNIQUE): Remove. * multiple_target.cc (INCLUDE_MEMORY): Remove. * omp-expand.cc (INCLUDE_MEMORY): Remove. * omp-general.cc (INCLUDE_MEMORY): Remove. * omp-low.cc (INCLUDE_MEMORY): Remove. * omp-oacc-neuter-broadcast.cc (INCLUDE_MEMORY): Remove. * omp-offload.cc (INCLUDE_MEMORY): Remove. * omp-simd-clone.cc (INCLUDE_MEMORY): Remove. * opt-problem.cc (INCLUDE_MEMORY): Remove. * optinfo-emit-json.cc (INCLUDE_MEMORY): Remove. * optinfo.cc (INCLUDE_MEMORY): Remove. * optinfo.h: Don't check INCLUDE_MEMORY. * opts-common.cc (INCLUDE_MEMORY): Remove. * opts-diagnostic.cc (INCLUDE_MEMORY): Remove. * opts-global.cc (INCLUDE_MEMORY): Remove. * opts.cc (INCLUDE_MEMORY): Remove. * pair-fusion.cc (INCLUDE_MEMORY): Remove. * passes.cc (INCLUDE_MEMORY): Remove. * pointer-query.cc (INCLUDE_MEMORY): Remove. * predict.cc (INCLUDE_MEMORY): Remove. * pretty-print.cc (INCLUDE_MEMORY): Remove. * pretty-print.h: Don't check INCLUDE_MEMORY. * print-rtl.cc (INCLUDE_MEMORY): Remove. * print-tree.cc (INCLUDE_MEMORY): Remove. * profile-count.cc (INCLUDE_MEMORY): Remove. * range-op-float.cc (INCLUDE_MEMORY): Remove. * range-op-ptr.cc (INCLUDE_MEMORY): Remove. * range-op.cc (INCLUDE_MEMORY): Remove. * range.cc (INCLUDE_MEMORY): Remove. * read-rtl-function.cc (INCLUDE_MEMORY): Remove. * rtl-error.cc (INCLUDE_MEMORY): Remove. * rtl-ssa/accesses.cc (INCLUDE_MEMORY): Remove. * rtl-ssa/blocks.cc (INCLUDE_MEMORY): Remove. * rtl-ssa/changes.cc (INCLUDE_MEMORY): Remove. * rtl-ssa/functions.cc (INCLUDE_MEMORY): Remove. * rtl-ssa/insns.cc (INCLUDE_MEMORY): Remove. * rtl-ssa/movement.cc (INCLUDE_MEMORY): Remove. * rtl-tests.cc (INCLUDE_MEMORY): Remove. * sanopt.cc (INCLUDE_MEMORY): Remove. * sched-rgn.cc (INCLUDE_MEMORY): Remove. * selftest-diagnostic-path.cc (INCLUDE_MEMORY): Remove. * selftest-diagnostic.cc (INCLUDE_MEMORY): Remove. * selftest-json.cc (INCLUDE_MEMORY): Remove. * sese.cc (INCLUDE_MEMORY): Remove. * simple-diagnostic-path.cc (INCLUDE_MEMORY): Remove. * splay-tree-utils.cc (INCLUDE_MEMORY): Remove. * sreal.cc (INCLUDE_MEMORY): Remove. * stmt.cc (INCLUDE_MEMORY): Remove. * substring-locations.cc (INCLUDE_MEMORY): Remove. * symtab-clones.cc (INCLUDE_MEMORY): Remove. * symtab-thunks.cc (INCLUDE_MEMORY): Remove. * symtab.cc (INCLUDE_MEMORY): Remove. * system.h: Include memory unconditionally for C++. Also remove support for INCLUDE_MEMORY. * targhooks.cc (INCLUDE_MEMORY): Remove. * text-art/box-drawing.cc (INCLUDE_MEMORY): Remove. * text-art/canvas.cc (INCLUDE_MEMORY): Remove. * text-art/ruler.cc (INCLUDE_MEMORY): Remove. * text-art/selftests.cc (INCLUDE_MEMORY): Remove. * text-art/style.cc (INCLUDE_MEMORY): Remove. * text-art/styled-string.cc (INCLUDE_MEMORY): Remove. * text-art/table.cc (INCLUDE_MEMORY): Remove. * text-art/theme.cc (INCLUDE_MEMORY): Remove. * text-art/tree-widget.cc (INCLUDE_MEMORY): Remove. * text-art/widget.cc (INCLUDE_MEMORY): Remove. * timevar.cc (INCLUDE_MEMORY): Remove. * toplev.cc (INCLUDE_MEMORY): Remove. * trans-mem.cc (INCLUDE_MEMORY): Remove. * tree-affine.cc (INCLUDE_MEMORY): Remove. * tree-assume.cc (INCLUDE_MEMORY): Remove. * tree-call-cdce.cc (INCLUDE_MEMORY): Remove. * tree-cfg.cc (INCLUDE_MEMORY): Remove. * tree-chrec.cc (INCLUDE_MEMORY): Remove. * tree-data-ref.cc (INCLUDE_MEMORY): Remove. * tree-dfa.cc (INCLUDE_MEMORY): Remove. * tree-diagnostic-client-data-hooks.cc (INCLUDE_MEMORY): Remove. * tree-diagnostic.cc (INCLUDE_MEMORY): Remove. * tree-dump.cc (INCLUDE_MEMORY): Remove. * tree-if-conv.cc (INCLUDE_MEMORY): Remove. * tree-inline.cc (INCLUDE_MEMORY): Remove. * tree-into-ssa.cc (INCLUDE_MEMORY): Remove. * tree-logical-location.cc (INCLUDE_MEMORY): Remove. * tree-loop-distribution.cc (INCLUDE_MEMORY): Remove. * tree-nested.cc (INCLUDE_MEMORY): Remove. * tree-nrv.cc (INCLUDE_MEMORY): Remove. * tree-object-size.cc (INCLUDE_MEMORY): Remove. * tree-outof-ssa.cc (INCLUDE_MEMORY): Remove. * tree-parloops.cc (INCLUDE_MEMORY): Remove. * tree-predcom.cc (INCLUDE_MEMORY): Remove. * tree-pretty-print.cc (INCLUDE_MEMORY): Remove. * tree-profile.cc (INCLUDE_MEMORY): Remove. * tree-scalar-evolution.cc (INCLUDE_MEMORY): Remove. * tree-sra.cc (INCLUDE_MEMORY): Remove. * tree-ssa-address.cc (INCLUDE_MEMORY): Remove. * tree-ssa-alias.cc (INCLUDE_MEMORY): Remove. * tree-ssa-ccp.cc (INCLUDE_MEMORY): Remove. * tree-ssa-coalesce.cc (INCLUDE_MEMORY): Remove. * tree-ssa-copy.cc (INCLUDE_MEMORY): Remove. * tree-ssa-dce.cc (INCLUDE_MEMORY): Remove. * tree-ssa-dom.cc (INCLUDE_MEMORY): Remove. * tree-ssa-dse.cc (INCLUDE_MEMORY): Remove. * tree-ssa-forwprop.cc (INCLUDE_MEMORY): Remove. * tree-ssa-ifcombine.cc (INCLUDE_MEMORY): Remove. * tree-ssa-live.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-ch.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-im.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-ivcanon.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-ivopts.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-manip.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-niter.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-prefetch.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-split.cc (INCLUDE_MEMORY): Remove. * tree-ssa-loop-unswitch.cc (INCLUDE_MEMORY): Remove. * tree-ssa-math-opts.cc (INCLUDE_MEMORY): Remove. * tree-ssa-operands.cc (INCLUDE_MEMORY): Remove. * tree-ssa-phiopt.cc (INCLUDE_MEMORY): Remove. * tree-ssa-phiprop.cc (INCLUDE_MEMORY): Remove. * tree-ssa-pre.cc (INCLUDE_MEMORY): Remove. * tree-ssa-propagate.cc (INCLUDE_MEMORY): Remove. * tree-ssa-reassoc.cc (INCLUDE_MEMORY): Remove. * tree-ssa-sccvn.cc (INCLUDE_MEMORY): Remove. * tree-ssa-scopedtables.cc (INCLUDE_MEMORY): Remove. * tree-ssa-sink.cc (INCLUDE_MEMORY): Remove. * tree-ssa-strlen.cc (INCLUDE_MEMORY): Remove. * tree-ssa-structalias.cc (INCLUDE_MEMORY): Remove. * tree-ssa-ter.cc (INCLUDE_MEMORY): Remove. * tree-ssa-threadbackward.cc (INCLUDE_MEMORY): Remove. * tree-ssa-threadupdate.cc (INCLUDE_MEMORY): Remove. * tree-ssa-uninit.cc (INCLUDE_MEMORY): Remove. * tree-ssa.cc (INCLUDE_MEMORY): Remove. * tree-ssanames.cc (INCLUDE_MEMORY): Remove. * tree-stdarg.cc (INCLUDE_MEMORY): Remove. * tree-streamer-in.cc (INCLUDE_MEMORY): Remove. * tree-streamer-out.cc (INCLUDE_MEMORY): Remove. * tree-streamer.cc (INCLUDE_MEMORY): Remove. * tree-switch-conversion.cc (INCLUDE_MEMORY): Remove. * tree-tailcall.cc (INCLUDE_MEMORY): Remove. * tree-vect-data-refs.cc (INCLUDE_MEMORY): Remove. * tree-vect-generic.cc (INCLUDE_MEMORY): Remove. * tree-vect-loop-manip.cc (INCLUDE_MEMORY): Remove. * tree-vect-loop.cc (INCLUDE_MEMORY): Remove. * tree-vect-patterns.cc (INCLUDE_MEMORY): Remove. * tree-vect-slp-patterns.cc (INCLUDE_MEMORY): Remove. * tree-vect-slp.cc (INCLUDE_MEMORY): Remove. * tree-vect-stmts.cc (INCLUDE_MEMORY): Remove. * tree-vectorizer.cc (INCLUDE_MEMORY): Remove. * tree-vrp.cc (INCLUDE_MEMORY): Remove. * tree.cc (INCLUDE_MEMORY): Remove. * ubsan.cc (INCLUDE_MEMORY): Remove. * value-pointer-equiv.cc (INCLUDE_MEMORY): Remove. * value-prof.cc (INCLUDE_MEMORY): Remove. * value-query.cc (INCLUDE_MEMORY): Remove. * value-range-pretty-print.cc (INCLUDE_MEMORY): Remove. * value-range-storage.cc (INCLUDE_MEMORY): Remove. * value-range.cc (INCLUDE_MEMORY): Remove. * value-relation.cc (INCLUDE_MEMORY): Remove. * var-tracking.cc (INCLUDE_MEMORY): Remove. * varpool.cc (INCLUDE_MEMORY): Remove. * vr-values.cc (INCLUDE_MEMORY): Remove. * wide-int-print.cc (INCLUDE_MEMORY): Remove. gcc/c-family/ChangeLog: * c-ada-spec.cc (INCLUDE_MEMORY): Remove. * c-attribs.cc (INCLUDE_MEMORY): Remove. * c-common.cc (INCLUDE_MEMORY): Remove. * c-format.cc (INCLUDE_MEMORY): Remove. * c-gimplify.cc (INCLUDE_MEMORY): Remove. * c-indentation.cc (INCLUDE_MEMORY): Remove. * c-opts.cc (INCLUDE_MEMORY): Remove. * c-pch.cc (INCLUDE_MEMORY): Remove. * c-pragma.cc (INCLUDE_MEMORY): Remove. * c-pretty-print.cc (INCLUDE_MEMORY): Remove. * c-type-mismatch.cc (INCLUDE_MEMORY): Remove. * c-warn.cc (INCLUDE_MEMORY): Remove. * known-headers.cc (INCLUDE_MEMORY): Remove. * name-hint.h: Remove check of INCLUDE_MEMORY. gcc/c/ChangeLog: * c-aux-info.cc (INCLUDE_MEMORY): Remove. * c-convert.cc (INCLUDE_MEMORY): Remove. * c-decl.cc (INCLUDE_MEMORY): Remove. * c-errors.cc (INCLUDE_MEMORY): Remove. * c-fold.cc (INCLUDE_MEMORY): Remove. * c-lang.cc (INCLUDE_MEMORY): Remove. * c-objc-common.cc (INCLUDE_MEMORY): Remove. * c-parser.cc (INCLUDE_MEMORY): Remove. * c-typeck.cc (INCLUDE_MEMORY): Remove. * gimple-parser.cc (INCLUDE_MEMORY): Remove. gcc/cp/ChangeLog: * call.cc (INCLUDE_MEMORY): Remove. * class.cc (INCLUDE_MEMORY): Remove. * constexpr.cc (INCLUDE_MEMORY): Remove. * constraint.cc (INCLUDE_MEMORY): Remove. * contracts.cc (INCLUDE_MEMORY): Remove. * coroutines.cc (INCLUDE_MEMORY): Remove. * cp-gimplify.cc (INCLUDE_MEMORY): Remove. * cp-lang.cc (INCLUDE_MEMORY): Remove. * cp-objcp-common.cc (INCLUDE_MEMORY): Remove. * cp-ubsan.cc (INCLUDE_MEMORY): Remove. * cvt.cc (INCLUDE_MEMORY): Remove. * cxx-pretty-print.cc (INCLUDE_MEMORY): Remove. * decl.cc (INCLUDE_MEMORY): Remove. * decl2.cc (INCLUDE_MEMORY): Remove. * dump.cc (INCLUDE_MEMORY): Remove. * error.cc (INCLUDE_MEMORY): Remove. * except.cc (INCLUDE_MEMORY): Remove. * expr.cc (INCLUDE_MEMORY): Remove. * friend.cc (INCLUDE_MEMORY): Remove. * init.cc (INCLUDE_MEMORY): Remove. * lambda.cc (INCLUDE_MEMORY): Remove. * lex.cc (INCLUDE_MEMORY): Remove. * logic.cc (INCLUDE_MEMORY): Remove. * mangle.cc (INCLUDE_MEMORY): Remove. * mapper-client.cc (INCLUDE_MEMORY): Remove. * mapper-resolver.cc (INCLUDE_MEMORY): Remove. * method.cc (INCLUDE_MEMORY): Remove. * module.cc (INCLUDE_MEMORY): Remove. * name-lookup.cc (INCLUDE_MEMORY): Remove. * optimize.cc (INCLUDE_MEMORY): Remove. * parser.cc (INCLUDE_MEMORY): Remove. * pt.cc (INCLUDE_MEMORY): Remove. * ptree.cc (INCLUDE_MEMORY): Remove. * rtti.cc (INCLUDE_MEMORY): Remove. * search.cc (INCLUDE_MEMORY): Remove. * semantics.cc (INCLUDE_MEMORY): Remove. * tree.cc (INCLUDE_MEMORY): Remove. * typeck.cc (INCLUDE_MEMORY): Remove. * typeck2.cc (INCLUDE_MEMORY): Remove. * vtable-class-hierarchy.cc (INCLUDE_MEMORY): Remove. gcc/d/ChangeLog: * d-attribs.cc (INCLUDE_MEMORY): Remove. * d-builtins.cc (INCLUDE_MEMORY): Remove. * d-codegen.cc (INCLUDE_MEMORY): Remove. * d-convert.cc (INCLUDE_MEMORY): Remove. * d-diagnostic.cc (INCLUDE_MEMORY): Remove. * d-frontend.cc (INCLUDE_MEMORY): Remove. * d-lang.cc (INCLUDE_MEMORY): Remove. * d-longdouble.cc (INCLUDE_MEMORY): Remove. * d-target.cc (INCLUDE_MEMORY): Remove. * decl.cc (INCLUDE_MEMORY): Remove. * expr.cc (INCLUDE_MEMORY): Remove. * intrinsics.cc (INCLUDE_MEMORY): Remove. * modules.cc (INCLUDE_MEMORY): Remove. * toir.cc (INCLUDE_MEMORY): Remove. * typeinfo.cc (INCLUDE_MEMORY): Remove. * types.cc (INCLUDE_MEMORY): Remove. gcc/fortran/ChangeLog: * arith.cc (INCLUDE_MEMORY): Remove. * array.cc (INCLUDE_MEMORY): Remove. * bbt.cc (INCLUDE_MEMORY): Remove. * check.cc (INCLUDE_MEMORY): Remove. * class.cc (INCLUDE_MEMORY): Remove. * constructor.cc (INCLUDE_MEMORY): Remove. * convert.cc (INCLUDE_MEMORY): Remove. * cpp.cc (INCLUDE_MEMORY): Remove. * data.cc (INCLUDE_MEMORY): Remove. * decl.cc (INCLUDE_MEMORY): Remove. * dependency.cc (INCLUDE_MEMORY): Remove. * dump-parse-tree.cc (INCLUDE_MEMORY): Remove. * error.cc (INCLUDE_MEMORY): Remove. * expr.cc (INCLUDE_MEMORY): Remove. * f95-lang.cc (INCLUDE_MEMORY): Remove. * frontend-passes.cc (INCLUDE_MEMORY): Remove. * interface.cc (INCLUDE_MEMORY): Remove. * intrinsic.cc (INCLUDE_MEMORY): Remove. * io.cc (INCLUDE_MEMORY): Remove. * iresolve.cc (INCLUDE_MEMORY): Remove. * match.cc (INCLUDE_MEMORY): Remove. * matchexp.cc (INCLUDE_MEMORY): Remove. * misc.cc (INCLUDE_MEMORY): Remove. * module.cc (INCLUDE_MEMORY): Remove. * openmp.cc (INCLUDE_MEMORY): Remove. * options.cc (INCLUDE_MEMORY): Remove. * parse.cc (INCLUDE_MEMORY): Remove. * primary.cc (INCLUDE_MEMORY): Remove. * resolve.cc (INCLUDE_MEMORY): Remove. * scanner.cc (INCLUDE_MEMORY): Remove. * simplify.cc (INCLUDE_MEMORY): Remove. * st.cc (INCLUDE_MEMORY): Remove. * symbol.cc (INCLUDE_MEMORY): Remove. * target-memory.cc (INCLUDE_MEMORY): Remove. * trans-array.cc (INCLUDE_MEMORY): Remove. * trans-common.cc (INCLUDE_MEMORY): Remove. * trans-const.cc (INCLUDE_MEMORY): Remove. * trans-decl.cc (INCLUDE_MEMORY): Remove. * trans-expr.cc (INCLUDE_MEMORY): Remove. * trans-intrinsic.cc (INCLUDE_MEMORY): Remove. * trans-io.cc (INCLUDE_MEMORY): Remove. * trans-openmp.cc (INCLUDE_MEMORY): Remove. * trans-stmt.cc (INCLUDE_MEMORY): Remove. * trans-types.cc (INCLUDE_MEMORY): Remove. * trans.cc (INCLUDE_MEMORY): Remove. gcc/go/ChangeLog: * go-backend.cc (INCLUDE_MEMORY): Remove. * go-lang.cc (INCLUDE_MEMORY): Remove. gcc/jit/ChangeLog: * dummy-frontend.cc (INCLUDE_MEMORY): Remove. * jit-playback.cc (INCLUDE_MEMORY): Remove. * jit-recording.cc (INCLUDE_MEMORY): Remove. gcc/lto/ChangeLog: * lto-common.cc (INCLUDE_MEMORY): Remove. * lto-dump.cc (INCLUDE_MEMORY): Remove. * lto-partition.cc (INCLUDE_MEMORY): Remove. * lto-symtab.cc (INCLUDE_MEMORY): Remove. * lto.cc (INCLUDE_MEMORY): Remove. gcc/m2/ChangeLog: * gm2-gcc/gcc-consolidation.h (INCLUDE_MEMORY): Remove. * gm2-gcc/m2configure.cc (INCLUDE_MEMORY): Remove. * mc-boot/GASCII.cc (INCLUDE_MEMORY): Remove. * mc-boot/GASCII.h (INCLUDE_MEMORY): Remove. * mc-boot/GArgs.cc (INCLUDE_MEMORY): Remove. * mc-boot/GArgs.h (INCLUDE_MEMORY): Remove. * mc-boot/GAssertion.cc (INCLUDE_MEMORY): Remove. * mc-boot/GAssertion.h (INCLUDE_MEMORY): Remove. * mc-boot/GBreak.cc (INCLUDE_MEMORY): Remove. * mc-boot/GBreak.h (INCLUDE_MEMORY): Remove. * mc-boot/GCOROUTINES.h (INCLUDE_MEMORY): Remove. * mc-boot/GCmdArgs.cc (INCLUDE_MEMORY): Remove. * mc-boot/GCmdArgs.h (INCLUDE_MEMORY): Remove. * mc-boot/GDebug.cc (INCLUDE_MEMORY): Remove. * mc-boot/GDebug.h (INCLUDE_MEMORY): Remove. Remove. * mc-boot/GDynamicStrings.cc (INCLUDE_MEMORY): Remove. * mc-boot/GDynamicStrings.h (INCLUDE_MEMORY): Remove. * mc-boot/GEnvironment.cc (INCLUDE_MEMORY): Remove. * mc-boot/GEnvironment.h (INCLUDE_MEMORY): Remove. * mc-boot/GFIO.cc (INCLUDE_MEMORY): Remove. * mc-boot/GFIO.h (INCLUDE_MEMORY): Remove. * mc-boot/GFormatStrings.cc (INCLUDE_MEMORY): Remove. * mc-boot/GFormatStrings.h (INCLUDE_MEMORY): Remove. * mc-boot/GFpuIO.cc (INCLUDE_MEMORY): Remove. * mc-boot/GFpuIO.h (INCLUDE_MEMORY): Remove. * mc-boot/GIO.cc (INCLUDE_MEMORY): Remove. * mc-boot/GIO.h (INCLUDE_MEMORY): Remove. * mc-boot/GIndexing.cc (INCLUDE_MEMORY): Remove. * mc-boot/GIndexing.h (INCLUDE_MEMORY): Remove. * mc-boot/GM2Dependent.cc (INCLUDE_MEMORY): Remove. * mc-boot/GM2Dependent.h (INCLUDE_MEMORY): Remove. * mc-boot/GM2EXCEPTION.cc (INCLUDE_MEMORY): Remove. * mc-boot/GM2EXCEPTION.h (INCLUDE_MEMORY): Remove. * mc-boot/GM2RTS.cc (INCLUDE_MEMORY): Remove. * mc-boot/GM2RTS.h (INCLUDE_MEMORY): Remove. Remove. * mc-boot/GMemUtils.cc (INCLUDE_MEMORY): Remove. * mc-boot/GMemUtils.h (INCLUDE_MEMORY): Remove. * mc-boot/GNumberIO.cc (INCLUDE_MEMORY): Remove. * mc-boot/GNumberIO.h (INCLUDE_MEMORY): Remove. * mc-boot/GPushBackInput.cc (INCLUDE_MEMORY): Remove. * mc-boot/GPushBackInput.h (INCLUDE_MEMORY): Remove. * mc-boot/GRTExceptions.cc (INCLUDE_MEMORY): Remove. * mc-boot/GRTExceptions.h (INCLUDE_MEMORY): Remove. * mc-boot/GRTco.h (INCLUDE_MEMORY): Remove. * mc-boot/GRTentity.h (INCLUDE_MEMORY): Remove. * mc-boot/GRTint.cc (INCLUDE_MEMORY): Remove. * mc-boot/GRTint.h (INCLUDE_MEMORY): Remove. * mc-boot/GSArgs.cc (INCLUDE_MEMORY): Remove. * mc-boot/GSArgs.h (INCLUDE_MEMORY): Remove. * mc-boot/GSFIO.cc (INCLUDE_MEMORY): Remove. * mc-boot/GSFIO.h (INCLUDE_MEMORY): Remove. * mc-boot/GSYSTEM.h (INCLUDE_MEMORY): Remove. * mc-boot/GSelective.h (INCLUDE_MEMORY): Remove. * mc-boot/GStdIO.cc (INCLUDE_MEMORY): Remove. * mc-boot/GStdIO.h (INCLUDE_MEMORY): Remove. * mc-boot/GStorage.cc (INCLUDE_MEMORY): Remove. * mc-boot/GStorage.h (INCLUDE_MEMORY): Remove. * mc-boot/GStrCase.cc (INCLUDE_MEMORY): Remove. * mc-boot/GStrCase.h (INCLUDE_MEMORY): Remove. * mc-boot/GStrIO.cc (INCLUDE_MEMORY): Remove. * mc-boot/GStrIO.h (INCLUDE_MEMORY): Remove. * mc-boot/GStrLib.cc (INCLUDE_MEMORY): Remove. * mc-boot/GStrLib.h (INCLUDE_MEMORY): Remove. * mc-boot/GStringConvert.cc (INCLUDE_MEMORY): Remove. * mc-boot/GStringConvert.h (INCLUDE_MEMORY): Remove. * mc-boot/GSysExceptions.h (INCLUDE_MEMORY): Remove. * mc-boot/GSysStorage.cc (INCLUDE_MEMORY): Remove. * mc-boot/GSysStorage.h (INCLUDE_MEMORY): Remove. * mc-boot/GTimeString.cc (INCLUDE_MEMORY): Remove. * mc-boot/GTimeString.h (INCLUDE_MEMORY): Remove. * mc-boot/GUnixArgs.h (INCLUDE_MEMORY): Remove. * mc-boot/Galists.cc (INCLUDE_MEMORY): Remove. * mc-boot/Galists.h (INCLUDE_MEMORY): Remove. * mc-boot/Gdecl.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gdecl.h (INCLUDE_MEMORY): Remove. * mc-boot/Gdtoa.h (INCLUDE_MEMORY): Remove. * mc-boot/Gerrno.h (INCLUDE_MEMORY): Remove. * mc-boot/Gkeyc.cc (INCLUDE_MEMORY): Remove. (checkGccConfigSystem): Remove printing out `#define INCLUDE_MEMORY`. * mc-boot/Gkeyc.h (INCLUDE_MEMORY): Remove. * mc-boot/Gldtoa.h (INCLUDE_MEMORY): Remove. * mc-boot/Glibc.h (INCLUDE_MEMORY): Remove. * mc-boot/Glibm.h (INCLUDE_MEMORY): Remove. * mc-boot/Glists.cc (INCLUDE_MEMORY): Remove. * mc-boot/Glists.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcComment.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcComment.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcComp.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcComp.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcDebug.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcDebug.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcError.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcError.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcFileName.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcFileName.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcLexBuf.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcLexBuf.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcMetaError.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcMetaError.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcOptions.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcOptions.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcPreprocess.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcPreprocess.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcPretty.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcPretty.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcPrintf.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcPrintf.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcQuiet.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcQuiet.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcReserved.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcReserved.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcSearch.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcSearch.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcStack.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcStack.h (INCLUDE_MEMORY): Remove. * mc-boot/GmcStream.cc (INCLUDE_MEMORY): Remove. * mc-boot/GmcStream.h (INCLUDE_MEMORY): Remove. * mc-boot/Gmcflex.h (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp1.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp1.h (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp2.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp2.h (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp3.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp3.h (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp4.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp4.h (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp5.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gmcp5.h (INCLUDE_MEMORY): Remove. * mc-boot/GnameKey.cc (INCLUDE_MEMORY): Remove. * mc-boot/GnameKey.h (INCLUDE_MEMORY): Remove. * mc-boot/GsymbolKey.cc (INCLUDE_MEMORY): Remove. * mc-boot/GsymbolKey.h (INCLUDE_MEMORY): Remove. * mc-boot/Gtermios.h (INCLUDE_MEMORY): Remove. * mc-boot/Gtop.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gvarargs.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gvarargs.h (INCLUDE_MEMORY): Remove. * mc-boot/Gwlists.cc (INCLUDE_MEMORY): Remove. * mc-boot/Gwlists.h (INCLUDE_MEMORY): Remove. * mc-boot/Gwrapc.h (INCLUDE_MEMORY): Remove. * pge-boot/GIndexing.h (INCLUDE_MEMORY): Remove. * pge-boot/GSEnvironment.h (INCLUDE_MEMORY): Remove. * pge-boot/GScan.h (INCLUDE_MEMORY): Remove. gcc/objc/ChangeLog: * objc-act.cc (INCLUDE_MEMORY): Remove. * objc-encoding.cc (INCLUDE_MEMORY): Remove. * objc-gnu-runtime-abi-01.cc (INCLUDE_MEMORY): Remove. * objc-lang.cc (INCLUDE_MEMORY): Remove. * objc-next-runtime-abi-01.cc (INCLUDE_MEMORY): Remove. * objc-next-runtime-abi-02.cc (INCLUDE_MEMORY): Remove. * objc-runtime-shared-support.cc (INCLUDE_MEMORY): Remove. gcc/objcp/ChangeLog: * objcp-decl.cc (INCLUDE_MEMORY): Remove. * objcp-lang.cc (INCLUDE_MEMORY): Remove. gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (INCLUDE_MEMORY): Remove. * rust-attribs.cc (INCLUDE_MEMORY): Remove. * rust-system.h (INCLUDE_MEMORY): Remove. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
2024-11-21c: Add u{,l,ll,imax}abs builtins [PR117024]Jakub Jelinek1-0/+1
The following patch adds u{,l,ll,imax}abs builtins, which just fold to ABSU_EXPR, similarly to how {,l,ll,imax}abs builtins fold to ABS_EXPR. 2024-11-21 Jakub Jelinek <jakub@redhat.com> PR c/117024 gcc/ * coretypes.h (enum function_class): Add function_c2y_misc enumerator. * builtin-types.def (BT_FN_UINTMAX_INTMAX, BT_FN_ULONG_LONG, BT_FN_ULONGLONG_LONGLONG): New DEF_FUNCTION_TYPE_1s. * builtins.def (DEF_C2Y_BUILTIN): Define. (BUILT_IN_UABS, BUILT_IN_UIMAXABS, BUILT_IN_ULABS, BUILT_IN_ULLABS): New builtins. * builtins.cc (fold_builtin_abs): Handle also folding of u*abs to ABSU_EXPR. (fold_builtin_1): Handle BUILT_IN_U{,L,LL,IMAX}ABS. gcc/lto/ChangeLog: * lto-lang.cc (flag_isoc2y): New variable. gcc/ada/ChangeLog: * gcc-interface/utils.cc (flag_isoc2y): New variable. gcc/testsuite/ * gcc.c-torture/execute/builtins/lib/abs.c (uintmax_t): New typedef. (uabs, ulabs, ullabs, uimaxabs): New functions. * gcc.c-torture/execute/builtins/uabs-1.c: New test. * gcc.c-torture/execute/builtins/uabs-1.x: New file. * gcc.c-torture/execute/builtins/uabs-1-lib.c: New file. * gcc.c-torture/execute/builtins/uabs-2.c: New test. * gcc.c-torture/execute/builtins/uabs-2.x: New file. * gcc.c-torture/execute/builtins/uabs-2-lib.c: New file. * gcc.c-torture/execute/builtins/uabs-3.c: New test. * gcc.c-torture/execute/builtins/uabs-3.x: New test. * gcc.c-torture/execute/builtins/uabs-3-lib.c: New test.
2024-11-14ada: Avoid doing unnecessary work in elaborate_expression_2Eric Botcazou1-9/+24
This prevents the expression from being tweaked by the match.pd machinery in the process, which can damage the readability of the -gnatR3 output. gcc/ada/ChangeLog: * gcc-interface/decl.cc (elaborate_expression_2): Do not divide and multiply back if the alignment factor is already explicit.
2024-11-12ada: Typo fix in commentMarc Poulhiès1-1/+1
gcc/ada/ChangeLog: * gcc-interface/Makefile.in: Remove extra 'with'.
2024-11-04ada: Move special case for null string literal from frontend to backendPiotr Trojanek1-2/+12
Previously the lower bound of string literals indexed by non-static integer types was artificially set to 1 in the frontend. This was to avoid an overflow in calculation of a null string size by the GCC backend, which was causing an excessively large binary object file. However, setting the lower bound to 1 was problematic for GNATprove, which could not easily retrieve the lower bound of string literals. This patch avoids the overflow in GCC by recognizing null string literal subtypes in Gigi. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Recognize null string literal subtypes and set their bounds to 1 .. 0.
2024-11-04ada: Remove special case for the size of a string literal subtypePiotr Trojanek1-6/+2
Apparently we no longer need to ignore string literal subtypes case when validating size of a type entity. Code cleanup; behavior appears to be unaffected. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Remove special case for string literal subtypes.
2024-11-04ada: Fix ancient typo in process_declsEric Botcazou1-6/+2
It has gone unnoticed for decades because it changes nothing in practice. gcc/ada/ChangeLog: * gcc-interface/trans.cc (process_decls): Remove tests on Nkind that contain a typo and would be redundant if written correctly.
2024-10-29diagnostics: support multiple output formats simultaneously [PR116613]David Malcolm1-3/+3
This patch generalizes diagnostic_context so that rather than having a single output format, it has a vector of zero or more. It adds new two options: -fdiagnostics-add-output=DIAGNOSTICS-OUTPUT-SPEC -fdiagnostics-set-output=DIAGNOSTICS-OUTPUT-SPEC which both take a new configuration syntax of the form SCHEME ("text" or "sarif"), optionally followed by ":" and one or more KEY=VALUE pairs, in this form: <SCHEME> <SCHEME>:<KEY>=<VALUE> <SCHEME>:<KEY>=<VALUE>,<KEY2>=<VALUE2> ...etc where each SCHEME supports some set of keys. For example, it's now possible to use: -fdiagnostics-add-output=sarif:version=2.1,file=foo.2.1.sarif \ -fdiagnostics-add-output=sarif:version=2.2-prerelease,file=foo.2.2.sarif to add a pair of outputs, each writing to a different file, using versions 2.1 and 2.2 of the SARIF standard respectively, whilst also emitting the classic text form of the diagnostics to stderr. I hope the new syntax gives us room to potentially add new kinds of output sink in the future (e.g. RPC notifications), and to add new key/value pairs as needed by the different sinks. Implementation-wise, the diagnostic_context's m_printer which previously was used directly by the single output format now becomes a "reference printer", created by the client (such as the frontend), with defaults modified by command-line options. Each of the multiple output sinks has its own pretty_printer instance, created by cloning the context's reference printer. gcc/ChangeLog: PR other/116613 * Makefile.in (OBJS-libcommon-target): Add opts-diagnostic.o. * common.opt (fdiagnostics-add-output=): New. (fdiagnostics-set-output=): New. (diagnostics_output_format): Drop sarif-file-2.2-prerelease from enum. * common.opt.urls: Regenerate. * diagnostic-buffer.h (diagnostic_buffer::~diagnostic_buffer): New. (diagnostic_buffer::ensure_per_format_buffer): Rename to... (diagnostic_buffer::ensure_per_format_buffers): ...this. (diagnostic_buffer::m_per_format_buffer): Replace with... (diagnostic_buffer::m_per_format_buffers): ...this, updating type. * diagnostic-format-json.cc (json_output_format::update_printer): New. (json_output_format::follows_reference_printer_p): New. (diagnostic_output_format_init_json): Drop redundant call to set_path_format, as this is not a text output format. * diagnostic-format-sarif.cc: Include "diagnostic-format-text.h". (sarif_builder::set_printer): New. (sarif_builder::sarif_builder): Add "printer" param and use it for m_printer. (sarif_builder::make_location_object::escape_nonascii_renderer::render): Rather than using dc.m_printer, create a diagnostic_text_output_format instance and use its printer. (sarif_output_format::follows_reference_printer_p): New. (sarif_output_format::update_printer): New. (sarif_output_format::sarif_output_format): Pass in correct printer to m_builder's ctor. (diagnostic_output_format_init_sarif): Drop redundant call to set_path_format, as this is not a text output format. Replace calls to pp_show_color and set_token_printer with call to update_printer. Drop redundant call to set_show_highlight_colors, as this printer does not show colors. (diagnostic_output_format_init_sarif_file): Split out file opening into... (diagnostic_output_format_open_sarif_file): ...this new function. (make_sarif_sink): New. (selftest::test_make_location_object): Provide a pp for the builder. * diagnostic-format-sarif.h (diagnostic_output_format_open_sarif_file): New decl. (make_sarif_sink): New decl. * diagnostic-format-text.cc (diagnostic_text_output_format::dump): Dump sm_follows_reference_printer. (diagnostic_text_output_format::on_report_verbatim): New. (diagnostic_text_output_format::follows_reference_printer_p): New. (diagnostic_text_output_format::update_printer): New. * diagnostic-format-text.h (diagnostic_text_output_format::diagnostic_text_output_format): Add optional "follows_reference_printer" param. (diagnostic_text_output_format::on_report_verbatim): New decl. (diagnostic_text_output_format::after_diagnostic): Drop "final". (diagnostic_text_output_format::follows_reference_printer_p): New decl. (class diagnostic_text_output_format): Convert private members to protected. (diagnostic_text_output_format::m_follows_reference_printer): New field. * diagnostic-format.h (diagnostic_output_format::on_report_verbatim): New vfunc. (diagnostic_output_format::follows_reference_printer_p): New vfunc. (diagnostic_output_format::update_printer): New vfunc. (diagnostic_output_format::get_printer): Use m_printer rather than a printer from m_context. (diagnostic_output_format::diagnostic_output_format): Initialize m_printer by cloning the context's printer. (diagnostic_output_format::m_printer): New field. * diagnostic-global-context.cc (verbatim): Reimplement in terms of global_dc->report_verbatim, moving existing implementation to diagnostic_text_output_format::on_report_verbatim. (fnotice): Support multiple output sinks by using a new global_dc->supports_fnotice_on_stderr_p. * diagnostic-output-file.h (diagnostic_output_file::diagnostic_output_file): New default ctor. (diagnostic_output_file::operator=): Implement move assignment. * diagnostic-path.cc (selftest::test_interprocedural_path_1): Pass false for new param of text_output's ctor. * diagnostic-show-locus.cc (selftest::test_layout_x_offset_display_utf8): Use reference printer. (selftest::test_layout_x_offset_display_tab): Likewise. (selftest::test_one_liner_fixit_remove): Likewise. * diagnostic.cc: Include "pretty-print-urlifier.h". (diagnostic_set_caret_max_width): Update for global_dc's m_printer becoming reference printer. (diagnostic_context::initialize): Update for m_printer becoming m_reference_printer. Use ::make_unique to create it. Update for m_output_format becoming m_output_sinks. (diagnostic_context::color_init): Update the reference printer, then update the printers for any output sinks that follow it. (diagnostic_context::urls_init): Likewise. (diagnostic_context::finish): Update comment. Update for m_output_format becoming m_output_sinks. Update for m_printer becoming m_reference_printer and use "delete" on it rather than XDELETE. (diagnostic_context::dump): Update for m_printer becoming reference printer, and for multiple output sinks. (diagnostic_context::set_output_format): Reimplement for supporting multiple output sinks. (diagnostic_context::get_output_format): Likewise. (diagnostic_context::add_sink): New. (diagnostic_context::supports_fnotice_on_stderr_p): New. (diagnostic_context::set_pretty_printer): New. (diagnostic_context::refresh_output_sinks): New. (diagnostic_context::set_format_decoder): New. (diagnostic_context::set_show_highlight_colors): New. (diagnostic_context::set_prefixing_rule): New. (diagnostic_context::report_diagnostic): Update to support multiple output sinks. (diagnostic_context::report_verbatim): New. (diagnostic_context::emit_diagram): Update to support multiple output sinks. (diagnostic_context::error_recursion): Update to use m_reference_printer. (fancy_abort): Likewise. (diagnostic_context::end_group): Update to support multiple output sinks. (diagnostic_output_format::dump): Implement. (diagnostic_output_format::on_report_verbatim): Likewise. (diagnostic_output_format_init): Drop DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE. (diagnostic_context::set_diagnostic_buffer): Reimplement to support multiple output sinks. (diagnostic_context::clear_diagnostic_buffer): Likewise. (diagnostic_context::flush_diagnostic_buffer): Likewise. (diagnostic_buffer::diagnostic_buffer): Initialize m_per_format_buffers. (diagnostic_buffer::~diagnostic_buffer): New dtor. (diagnostic_buffer::dump): Reimplement to support multiple output sinks. (diagnostic_buffer::empty_p): Likewise. (diagnostic_buffer::move_to): Likewise. (diagnostic_buffer::ensure_per_format_buffer): Likewise, renaming to... (diagnostic_buffer::ensure_per_format_buffers): ...this. * diagnostic.h (DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE_2_2_PRERELEASE): Delete. (class diagnostic_context): Add friend class diagnostic_buffer. (diagnostic_context::set_pretty_printer): New decl. (diagnostic_context::refresh_output_sinks): New decl. (diagnostic_context::report_verbatim): New decl. (diagnostic_context::get_output_format): Drop. (diagnostic_context::set_show_highlight_colors): Drop body. (diagnostic_context::set_format_decoder): New decl. (diagnostic_context::set_prefixing_rule): New decl. (diagnostic_context::clone_printer): Reimplement. (diagnostic_context::get_reference_printer): New accessor. (diagnostic_context::add_sink): New decl. (diagnostic_context::supports_fnotice_on_stderr_p): New decl. (diagnostic_context::m_printer): Replace with... (diagnostic_context::m_reference_printer): ...this, and make private. (diagnostic_context::m_output_format): Replace with... (diagnostic_context::m_output_sinks): ...this. (diagnostic_format_decoder): Delete. (diagnostic_prefixing_rule): Delete. (diagnostic_ready_p): Delete. * doc/invoke.texi: Document -fdiagnostics-add-output= and -fdiagnostics-set-output=. * gcc.cc: Include "opts-diagnostic.h". (driver_handle_option): Handle cases OPT_fdiagnostics_add_output_ and OPT_fdiagnostics_set_output_. * opts-diagnostic.cc: New file. * opts-diagnostic.h (handle_OPT_fdiagnostics_add_output_): New decl. (handle_OPT_fdiagnostics_set_output_): New decl. * opts-global.cc (init_options_once): Update for global_dc's m_printer becoming reference printer. Call global_dc->refresh_output_sinks. * opts.cc (common_handle_option): Replace use of diagnostic_prefixing_rule with dc->set_prefixing_rule. Handle cases OPT_fdiagnostics_add_output_ and OPT_fdiagnostics_set_output_. Update for m_printer becoming reference printer. * selftest-diagnostic.cc (selftest::test_diagnostic_context::test_diagnostic_context): Update for m_printer becoming reference printer. (test_diagnostic_context::test_show_locus): Likewise. * selftest-run-tests.cc (selftest::run_tests): Call selftest::opts_diagnostic_cc_tests. * selftest.h (selftest::opts_diagnostic_cc_tests): New decl. * simple-diagnostic-path.cc (selftest::simple_diagnostic_path_cc_tests): Use reference printer. * toplev.cc (announce_function): Update for global_dc's m_printer becoming reference printer. (toplev::main): Likewise. * tree-diagnostic.cc (tree_diagnostics_defaults): Replace use of diagnostic_format_decoder with context->set_format_decoder. * tree-diagnostic.h (tree_dump_pretty_printer::tree_dump_pretty_printer): Update for global_dc's m_printer becoming reference printer. * tree.cc (escaped_string::escape): Likewise. (selftest::test_escaped_strings): Likewise. gcc/ada/ChangeLog: PR other/116613 * gcc-interface/misc.cc (internal_error_function): Update for m_printer becoming reference printer. gcc/analyzer/ChangeLog: PR other/116613 * analyzer-language.cc (on_finish_translation_unit): Update for m_printer becoming reference printer. * engine.cc (run_checkers): Likewise. * program-point.cc (function_point::print_source_line): Likewise. gcc/c-family/ChangeLog: PR other/116613 * c-format.cc (selftest::test_type_mismatch_range_labels): Update for m_printer becoming reference printer. (selftest::test_type_mismatch_range_labels): Likewise. gcc/c/ChangeLog: PR other/116613 * c-objc-common.cc: Include "make-unique.h". (c_initialize_diagnostics): Use unique_ptr for pretty_printer. Use context->set_format_decoder. gcc/cp/ChangeLog: PR other/116613 * error.cc (cxx_initialize_diagnostics): Use unique_ptr for pretty_printer. Use context->set_format_decoder. * module.cc (noisy_p): Update for global_dc's m_printer becoming reference printer. gcc/d/ChangeLog: PR other/116613 * d-diagnostic.cc (d_diagnostic_report_diagnostic): Update for m_printer becoming reference printer. gcc/fortran/ChangeLog: PR other/116613 * error.cc (gfc_diagnostic_build_kind_prefix): Update for global_dc's m_printer becoming reference printer. (gfc_diagnostics_init): Replace usage of diagnostic_format_decoder with global_dc->set_format_decoder. gcc/jit/ChangeLog: PR other/116613 * dummy-frontend.cc: Include "make-unique.h". (class jit_diagnostic_listener): New. (jit_begin_diagnostic): Update comment. (jit_end_diagnostic): Drop call to add_diagnostic. (jit_langhook_init): Set the output format to a new jit_diagnostic_listener. * jit-playback.cc (playback::context::add_diagnostic): Add "text" param and use that rather than trying to get the text from a pretty_printer. * jit-playback.h (playback::context::add_diagnostic): Add "text" param. gcc/testsuite/ChangeLog: PR other/116613 * gcc.dg/plugin/analyzer_cpython_plugin.c (dump_refcnt_info): Update for global_dc's m_printer becoming reference printer. * gcc.dg/plugin/crash-test-ice-in-header-sarif-2.2.c: Replace usage of -fdiagnostics-format=sarif-file-2.2-prerelease with -fdiagnostics-set-output=sarif:version=2.2-prerelease. * gcc.dg/plugin/diagnostic_plugin_test_paths.c: Update for global_dc's m_printer becoming reference printer. * gcc.dg/plugin/diagnostic_plugin_xhtml_format.c: Update for changes to output formats. * gcc.dg/plugin/expensive_selftests_plugin.c: Update for global_dc's m_printer becoming reference printer. * gcc.dg/sarif-output/add-output-sarif-defaults.c: New test. * gcc.dg/sarif-output/bad-binary-op.c: New test. * gcc.dg/sarif-output/bad-binary-op.py: New support script. * gcc.dg/sarif-output/multiple-outputs.c: New test. * gcc.dg/sarif-output/multiple-outputs.py: New support script. * lib/scansarif.exp (verify-sarif-file): Add an optional second argument specifying the expected filename of the .sarif file. Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2024-10-25ada: Change scope of XUB typeTom Tromey1-1/+1
An earlier patch in the "nameless" series caused a regression with -fgnat-encodings=all. Previously, all artificial types were emitted in the CU scope in the DWARF, but with the patch, an "XUB" type is emitted in the function scope. This causes gdb lookups to erroneously find the XUB type rather than the type that gdb expects to find. Note that I don't know why the earlier code worked, because decl.cc clearly sets the XUB type's context to be the current function. This patch changes the type's context so that it is nested in a type that is conveniently available. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Use gnu_fat_type as the type context for a XUB type.
2024-10-25ada: Set DECL_NAMELESS in create_type_declTom Tromey3-7/+15
When using minimal encodings, most artificial types do not need to have their names emitted in the DWARF. This patch changes the compiler to generally omit these names. However, a subset of names are needed: when the compiler creates an artificial type for certain kinds of arrays, the name is needed by gdb. So, a new parameter is added to create_type_decl to allow this omission to be disabled. Note that simply passing 'false' as the artificial_p argument to create_type_decl doesn't work properly -- other parts of the compiler seem to rely on this flag being set, and so making this change causes ICEs. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Update some calls to create_type_decl. * gcc-interface/gigi.h (create_type_decl): Add can_be_nameless parameter. * gcc-interface/utils.cc (create_type_decl): Add can_be_nameless parameter. Set DECL_NAMELESS on type decl.
2024-10-25ada: Mark some type decls as namelessTom Tromey1-0/+3
The types created by record_builtin_type and create_type_stub_decl can be marked as nameless when using minimal encodings. In this situation, gdb does not need these type names. gcc/ada/ChangeLog: * gcc-interface/utils.cc (record_builtin_type, create_type_stub_decl): Set DECL_NAMELESS on type decls.
2024-10-25ada: Mark XUA types as artificialTom Tromey1-1/+1
gdb does not need the name of XUA types. This patch changes the compiler to unconditionally mark these as artificial; a subsequent patch will arrange for the name to be omitted. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_entity): Pass 'true' to create_type_decl when creating XUA type.