aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/doc
AgeCommit message (Collapse)AuthorFilesLines
2022-05-13[Ada] Document control flow redundancyAlexandre Oliva1-20/+76
Add documentation about -fharden-control-flow-redundancy. gcc/ada/ * doc/gnat_rm/security_hardening_features.rst: Add subsection on Control Flow Redundancy. * gnat_rm.texi: Regenerate.
2022-05-13[Ada] Remove obsolete uses of Unchecked_Conversion from Ada 83Piotr Trojanek1-3/+3
Similar to a recent removal of obsolete uses of Unchecked_Deallocation. In Ada 83 the Unchecked_Conversion was a top-level unit; since Ada 95 it is an obsolete renaming of Ada.Unchecked_Conversion. GNAT doesn't warn yet about uses of these obsolete renamings, but it still seems better to avoid them. gcc/ada/ * atree.adb, gen_il-gen.adb, osint.adb, set_targ.adb, sinput.adb, table.adb, treepr.adb, types.ads: Replace uses of Unchecked_Conversion in the compiler itself. * libgnarl/a-reatim.adb, libgnarl/s-osinte__gnu.ads, libgnarl/s-osinte__kfreebsd-gnu.ads, libgnat/a-coboho.adb, libgnat/a-stuten.ads, libgnat/s-putima.adb: Likewise in the runtime. * doc/gnat_ugn/gnat_and_program_execution.rst: Likewise in documentation. * gnat_ugn.texi: Regenerate.
2022-05-13[Ada] Remove obsolete uses of Unchecked_Deallocation from Ada 83Piotr Trojanek1-7/+7
In Ada 83 the Unchecked_Deallocation was a top-level unit; since Ada 95 it is an obsolete renaming of Ada.Unchecked_Deallocation. GNAT doesn't yet warn about uses of these obsolete renamings, but it still seems better to avoid them. Cleanup before adding a new instance of Unchecked_Deallocation. Offending occurrences found with grep. gcc/ada/ * butil.adb, sem.adb, sinput.adb, types.ads, xref_lib.adb: Replace uses of Unchecked_Deallocation with Ada.Unchecked_Deallocation. * doc/gnat_ugn/gnat_and_program_execution.rst: Likewise for the documentation; fix casing of GNAT.IO. * gnat_ugn.texi: Regenerate.
2022-05-12[Ada] Fix URL in docArnaud Charlet1-1/+1
gcc/ada/ * doc/gnat_ugn/the_gnat_compilation_model.rst: Fix URL. * gnat_ugn.texi: Regenerate.
2022-05-12[Ada] Introduce hardbool Machine_Attribute for AdaAlexandre Oliva1-0/+36
Implement and document hardened booleans, from nonstandard boolean types with representation clauses to the extra validity checking performed on boolean types annotated with the "hardbool" Machine_Attribute pragma. gcc/ada/ * doc/gnat_rm/security_hardening_features.rst (Hardened Booleans): New. * exp_util.adb (Adjust_Condition): Perform validity checking on hardbool-annotated types even with -gnatVT. * gnat_rm.texi: Regenerate. * gcc-interface/utils.cc (gnat_internal_attribute_table): Ignore hardbool.
2022-05-12[Ada] Fix typos in syntax for implementation-defined pragmasPiotr Trojanek1-4/+4
Documentation cleanup. Spotted while looking at description of configuration pragmas. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: (Export_Object, Import_Object, Short_Descriptors): Fix pragma syntax specification. * gnat_rm.texi: Regenerate.
2022-05-12[Ada] Document Aggregate_Individually_Assign as a configuration pragmaPiotr Trojanek1-0/+1
Pragma Aggregate_Individually_Assign was apparently forgotten to be listed in the GNAT User's Guide as a configuration pragma. gcc/ada/ * doc/gnat_ugn/the_gnat_compilation_model.rst (Configuration Pragmas): Add Aggregate_Individually_Assign; otherwise the list is complete except for some obsoleted pragmas, which most likely are intentionally omitted. * gnat_ugn.texi: Regenerate.
2022-05-11[Ada] Fix unbalanced paren in documentation marker for GNAT StudioPiotr Trojanek8-23/+23
Unbalanced parens can be found when editing in emacs using the "check-parens" command. Offending occurrences must be examined manually, because few of them are intentional. Minor cleanup of typos in documentation. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst, doc/gnat_rm/implementation_of_specific_ada_features.rst, doc/gnat_rm/representation_clauses_and_pragmas.rst, doc/gnat_rm/the_gnat_library.rst, doc/gnat_rm/the_implementation_of_standard_i_o.rst, doc/gnat_ugn/building_executable_programs_with_gnat.rst, doc/gnat_ugn/gnat_and_program_execution.rst, doc/gnat_ugn/platform_specific_information.rst: Fix unbalanced parentheses and brackets. * sem_prag.adb (pragma Obsolescent): Likewise. * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2022-05-11[Ada] New No_Local_Tagged_Types restrictionMarc Poulhiès1-0/+7
Add new configuration restriction No_Local_Tagged_Types. This new restriction ensures at compile time that all tagged types are only declared at the library level. gcc/ada/ * libgnat/s-rident.ads (Restriction_Id): Add No_Local_Tagged_Types, update comment for adding new GNAT specific restriction. * restrict.ads (Implementation_Restriction): Add No_Local_Tagged_Types. * sem_ch3.adb (Analyze_Full_Type_Declaration): Add check for tagged type at library level. * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Add No_Local_Tagged_Types description. * gnat_rm.texi: Regenerate.
2022-05-11[Ada] Add SUSE 32bit dependencyJoao Azevedo1-1/+4
On SUSE 15, glibc-locale-base-32bit is needed to run 32bit versions of Libadalang tools. gcc/ada/ * doc/gnat_ugn/platform_specific_information.rst: Add glibc-locale-base-32bit as a dependency in SUSE distributions. * gnat_ugn.texi: Regenerate.
2022-05-11[Ada] Fix formatting glitches in GNAT User's GuidePiotr Trojanek3-9/+9
Only enhancement of formatting. gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst, doc/gnat_ugn/gnat_utility_programs.rst, doc/gnat_ugn/inline_assembler.rst: Fix typos and formatting glitches. * gnat_ugn.texi: Regenerate.
2022-05-11[Ada] Use pygments for Ada code examples of elaboration controlPiotr Trojanek1-26/+26
Only enhancement of formatting. gcc/ada/ * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Change blocks from plain code to Ada.
2022-05-11[Ada] Fix layout of tables in PDF version of GNAT RMPiotr Trojanek1-0/+4
Tables with small left columns and large right columns had colliding text in the PDF version of GNAT RM. Spotted while adding description of pragma Ada_2022. gcc/ada/ * doc/gnat_rm/implementation_defined_characteristics.rst: Add tabularcolums directive, as explained in documentation of Sphinx and tabular LaTeX package.
2022-05-11[Ada] Fix layout in description of aspects and pragmasPiotr Trojanek2-20/+20
Remove extra whitespace in examples of pragmas and aspects. Spotted while adding description of pragma Ada_2022. gcc/ada/ * doc/gnat_rm/implementation_defined_aspects.rst, doc/gnat_rm/implementation_defined_pragmas.rst: Remove extra whitespace. * gnat_rm.texi: Regenerate.
2022-05-11[Ada] Fix markup in description of implementation-defined characteristicsPiotr Trojanek1-21/+21
Fix formatting of description lists, i.e. continuation lines are now indented like their preceding lines. Spotted while adding description of pragma Ada_2022. gcc/ada/ * doc/gnat_rm/implementation_defined_characteristics.rst: Remove extra indent in continuation lines; indent both descriptions of Max_Picture_Length. * gnat_rm.texi: Regenerate.
2022-05-11[Ada] Fix markup in description of pragma EliminatePiotr Trojanek1-21/+17
Fix formatting of a nested bullet lists. Spotted while adding description of pragma Ada_2022. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Pragma Eliminate): Fix markup. * gnat_rm.texi: Regenerate.
2022-05-11[Ada] Document pragma Ada_2022Piotr Trojanek2-0/+31
Pragma Ada_2022 is similar to existing pragma Ada_2012 and similarly deserves to be documented. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Pragma Ada_2022): Copy description from pragma Ada 2012 and adapt. * doc/gnat_ugn/the_gnat_compilation_model.rst (Configuration Pragmas): List pragma Ada 2022. * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2022-05-11[Ada] Properly reject unsupported address specificationsSteve Baird1-3/+14
In the case of an object declaration with an indefinite nominal subtype (roughly speaking, that's an object that takes its bounds, discriminants, and/or tag from its explicit initial value), GNAT does not support address specifications unless the size of the object is known at compile time. In some cases, such unsupported address specifications were not properly rejected. This could lead to either an internal error during compilation or (in the class-wide case) to a warning accompanied by raising Program_Error at run time. gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Replace the existing check for an address specification for an object of a class-wide type with a more general check which rejects either the class-wide case or the case where the FE would (if the address specification were accepted) build a malformed tree (specifically, an object renaming declaration with a specified address). In the case where the check fails, reject the construct at compile time instead of generating an unconditional raise of Program_Error. * doc/gnat_rm/representation_clauses_and_pragmas.rst: Update documentation to reflect these changes. * gnat_rm.texi: Regenerate.
2022-05-10[Ada] Fix a couple of typosKévin Le Gouguec2-3/+3
gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst, doc/gnat_ugn/the_gnat_compilation_model.rst: Fix typos. * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2022-05-09[Ada] Refine description of SPARK with static Boolean expressionsPiotr Trojanek1-14/+14
A number of SPARK pragmas controlled by an optional Boolean expression require those expressions to be static. This is now clarified in the GNAT RM. gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Abstract_State, Async_Readers, Async_Writers, Constant_After_Elaboration, Effective_Reads, Effective_Writes, Extensions_Visible, Ghost, No_Caching, Volatile_Function): Only static Boolean expressions are allowed. * gnat_rm.texi: Regenerate.
2022-05-09[Ada] Use "aspect" instead of "pragma" in warningsBob Duff1-1/+1
For warnings related to the Unreferenced, Unmodified, and Unused aspects, refer to the "aspect", not the "pragma". Note that the aspect can be set by an aspect_specification or a pragma, so the term "aspect" is correct even in the pragma case. However, messages in sem_prag.adb use Fix_Error, so they refer to "aspect" or "pragma". It's not clear that we really ought to refer to "pragma", now that those are obsolete, but de call Fix_Error for uniformity. We do not attempt to make Fix_Error available outside sem_prag.adb -- too much trouble for something that perhaps ought to be removed. gcc/ada/ * lib-xref.adb, sem_util.adb: Change wording of warning messages to use "aspect". * sem_prag.adb: Use Fix_Error to change wording of warnings. * doc/gnat_rm/implementation_defined_pragmas.rst: Minor: fix cut&paste error. * gnat_rm.texi: Regenerate.
2022-05-09[Ada] Remove gnattest section from gnat user guideFedor Rybin1-917/+0
gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Remove gnattest section.
2022-01-31[Ada] doc/share/conf.py: fix string handlingPierre-Marie de Rodat1-1/+1
gcc/ada/ * doc/share/conf.py: Remove spurious call to ".decode()".
2022-01-07[Ada] Cleanup and modification of unreferenced warningsJustin Squirek1-1/+3
gcc/ada/ * comperr.adb (Delete_SCIL_Files): Replace unnecessary Unreferenced pragma with specific pragma Warnings. * doc/gnat_rm/implementation_defined_pragmas.rst (Unreferenced): Add documentation for new behavior. * gnat_rm.texi: Regenerate. * erroutc.adb (Set_At): Remove useless assignment. * exp_ch2.adb (In_Assignment_Context): Deleted. (Is_Object_Renaming_Name): Replace calls to Is_LHS with calls to Known_To_Be_Assigned. (Expand_Current_Value): Replace calls to May_Be_Lvalue with calls to Known_To_Be_Assigned. (Expand_Entry_Paramter): Replace calls to In_Assignment_Context with calls to Known_To_Be_Assigned. * exp_ch4.adb (Expand_N_Op_Rem): Remove unnecessary Unreferenced pragma. * exp_imgv.adb (Build_Enumeration_Image_Tables): Default initialize S_N. * ghost.adb (Check_Ghost_Policy): Replace call to May_Be_Lvalue with call to Known_To_Be_Assigned. * lib-xref.adb (Is_On_LHS): Deleted. (OK_To_Set_Referenced): Rewrite subprogram to encompass the new pragma Unreferenced behavior. (Process_Deferred_References): Replace call to Is_LHS with call to Known_To_Be_Assigned. * libgnarl/s-taasde.adb, libgnarl/s-tasren.adb, libgnarl/s-tpobop.adb, libgnat/a-calend.adb, libgnat/a-calfor.adb, libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb, libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb, libgnat/a-cborma.adb, libgnat/a-cborse.adb, libgnat/a-cdlili.adb, libgnat/a-cfhama.adb, libgnat/a-cforse.adb, libgnat/a-cidlli.adb, libgnat/a-cihama.adb, libgnat/a-cihase.adb, libgnat/a-cimutr.adb, libgnat/a-ciorma.adb, libgnat/a-ciormu.adb, libgnat/a-ciorse.adb, libgnat/a-cohama.adb, libgnat/a-cohase.adb, libgnat/a-comutr.adb, libgnat/a-convec.adb, libgnat/a-coorma.adb, libgnat/a-coormu.adb, libgnat/a-coorse.adb, libgnat/a-crdlli.adb, libgnat/a-tigeau.adb, libgnat/a-wtgeau.adb, libgnat/a-ztgeau.adb, libgnat/g-calend.adb, libgnat/g-comlin.adb, libgnat/g-expect.adb, libgnat/g-mbflra.adb, libgnat/g-spipat.adb, libgnat/s-fatgen.adb, libgnat/s-fileio.adb, libgnat/s-os_lib.adb, libgnat/s-regpat.adb, libgnat/s-valued.adb, libgnat/s-valuer.adb: Remove unnecessary Unreferenced pragmas * sem_ch10.adb (Process_Spec_Clauses): Remove useless assignments. * sem_ch13.adb (Validate_Literal_Aspect): Default initialize I. * sem_ch3.adb (Build_Derived_Concurrent_Type): Default initialize Corr_Decl. * sem_ch8.adb (Undefined): Replace calls to Is_LHS with calls to Known_To_Be_Assigned. (In_Abstract_View_Pragma): Likewise. * sem_eval.adb (Eval_Selected_Component): Replace calls to Is_LHS with calls to Known_To_Be_Assigned. * sem_res.adb (Init_Component): Replace calls to May_Be_Lvalue with calls to Known_To_Be_Assigned. * sem_util.adb, sem_util.ads (End_Label_Loc): Default initialize Owner. (Explain_Limited_Type): Default initialize Expr_Func. (Find_Actual): Modified to handle entry families. (Is_LHS): Deleted. (May_Be_Lvalue): Deleted. (Known_To_Be_Assigned): Modified and improved to handle all cases. * sem_warn.adb (Traverse_Result): Replace calls to May_Be_Lvalue with calls to Known_To_Be_Assigned. (Check_Ref): Modify error on unreferenced out parameters to take into account different warning flags.
2022-01-07[Ada] Update -gnatwr doc for import of parent packageEtienne Servais1-0/+2
gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update -gnatwr documentation. * gnat_ugn.texi: Regenerate.
2022-01-06[Ada] New restriction No_Tagged_Type_RegistrationBob Duff1-1/+12
gcc/ada/ * libgnat/s-rident.ads (No_Tagged_Type_Registration): New restriction identifier. * restrict.ads (Implementation_Restriction): Add restriction. * exp_ch7.adb (Process_Declarations): Suppress tagged-type-related finalization actions if the restriction is active. Call RTE_Available last. * exp_disp.adb (Make_DT): Likewise. * exp_util.adb (Requires_Cleanup_Actions): Return False for a tagged type declaration if No_Tagged_Type_Registration is active. * sem_attr.adb (Check_Stream_Attribute): Check restriction No_Tagged_Type_Registration. * libgnat/a-except.ads (Null_Occurrence): Minor: Initialize, to avoid stopping at a warning in gdb. * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Document new restriction. * gnat_rm.texi: Regenerate.
2022-01-05[Ada] Remove Compiler_Unit[_Warning] pragmasMarc Poulhiès1-33/+0
gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst (Compiler_Unit) (Compiler_Unit_Warning): Remove. * gnat-style.texi, gnat_rm.texi, gnat_ugn.texi: Regenerate. * libgnat/g-dynhta.ads: Add comment indicating this unit is built during stage1. * libgnat/g-dyntab.ads: Likewise. * libgnat/g-graphs.ads: Likewise. * libgnat/g-lists.ads: Likewise. * libgnat/g-sets.ads: Likewise. * libgnat/gnat.ads: Likewise. * libgnat/s-pehage.ads: Likewise. * libgnat/s-resfil.ads: Likewise. * libgnat/s-rident.ads: Likewise. * libgnat/s-utf_32.ads: Likewise. * errout.ads: Update comment. * opt.ads (Opt): Remove Compiler_Unit. * par-ch5.adb (All_Pragmas): Remove call to Check_Compiler_Unit. * sem_prag.adb (Analyze_Pragma): Likewise. * sem_ch4.adb (Non_Static_Choice_Error, Analyze_If_Expression) (Analyze_Set_Membership, Record_Interp): Likewise. * sem_ch11.adb (Analyze_Raise_Expression): Likewise. * sem_ch6.adb: Remove Restric package reference. (Analyze_Extended_Return_Statement): Remove call to Check_Compiler_Unit. * par-prag.adb (Process_Restrictions_Or_Restriction_Warnings): Remove handling of Pragma_Compiler_Unit[_Warning}. * restrict.adb (Check_Compiler_Unit): Remove both. * restrict.ads: Likewise. * snames.ads-tmpl (Pragma_Id): Remove Pragma_Compiler_Unit[_Warning]. * libgnat/a-assert.ads: Remove pragma Compiler_Unit_Warning. * libgnat/a-chlat1.ads: Likewise. * libgnat/a-elchha.adb: Likewise. * libgnat/a-elchha.ads: Likewise. * libgnat/a-ioexce.ads: Likewise. * libgnat/a-strhas.ads: Likewise. * libgnat/g-byorma.adb: Likewise. * libgnat/g-byorma.ads: Likewise. * libgnat/g-dyntab.adb: Likewise. * libgnat/g-heasor.ads: Likewise. * libgnat/g-hesora.adb: Likewise. * libgnat/g-hesora.ads: Likewise. * libgnat/g-htable.adb: Likewise. * libgnat/g-htable.ads: Likewise. * libgnat/g-spchge.adb: Likewise. * libgnat/g-spchge.ads: Likewise. * libgnat/g-speche.adb: Likewise. * libgnat/g-speche.ads: Likewise. * libgnat/g-table.ads: Likewise. * libgnat/g-u3spch.adb: Likewise. * libgnat/g-u3spch.ads: Likewise. * libgnat/interfac.ads: Likewise. * libgnat/s-addope.adb: Likewise. * libgnat/s-addope.ads: Likewise. * libgnat/s-assert.adb: Likewise. * libgnat/s-assert.ads: Likewise. * libgnat/s-bitops.adb: Likewise. * libgnat/s-bitops.ads: Likewise. * libgnat/s-carun8.adb: Likewise. * libgnat/s-carun8.ads: Likewise. * libgnat/s-casuti.adb: Likewise. * libgnat/s-casuti.ads: Likewise. * libgnat/s-conca2.adb: Likewise. * libgnat/s-conca2.ads: Likewise. * libgnat/s-conca3.adb: Likewise. * libgnat/s-conca3.ads: Likewise. * libgnat/s-conca4.adb: Likewise. * libgnat/s-conca4.ads: Likewise. * libgnat/s-conca5.adb: Likewise. * libgnat/s-conca5.ads: Likewise. * libgnat/s-conca6.adb: Likewise. * libgnat/s-conca6.ads: Likewise. * libgnat/s-conca7.adb: Likewise. * libgnat/s-conca7.ads: Likewise. * libgnat/s-conca8.adb: Likewise. * libgnat/s-conca8.ads: Likewise. * libgnat/s-conca9.adb: Likewise. * libgnat/s-conca9.ads: Likewise. * libgnat/s-crc32.adb: Likewise. * libgnat/s-crc32.ads: Likewise. * libgnat/s-crtl.ads: Likewise. * libgnat/s-excdeb.adb: Likewise. * libgnat/s-excdeb.ads: Likewise. * libgnat/s-except.ads: Likewise. * libgnat/s-exctab.adb: Likewise. * libgnat/s-exctab.ads: Likewise. * libgnat/s-finmas.ads: Likewise. * libgnat/s-htable.adb: Likewise. * libgnat/s-htable.ads: Likewise. * libgnat/s-mastop.adb: Likewise. * libgnat/s-mastop.ads: Likewise. * libgnat/s-memory.adb: Likewise. * libgnat/s-memory.ads: Likewise. * libgnat/s-os_lib.ads: Likewise. * libgnat/s-parame.adb: Likewise. * libgnat/s-parame.ads: Likewise. * libgnat/s-parame__posix2008.ads: Likewise. * libgnat/s-purexc.ads: Likewise. * libgnat/s-resfil.adb: Likewise. * libgnat/s-restri.adb: Likewise. * libgnat/s-restri.ads: Likewise. * libgnat/s-secsta.adb: Likewise. * libgnat/s-secsta.ads: Likewise. * libgnat/s-soflin.adb: Likewise. * libgnat/s-soflin.ads: Likewise. * libgnat/s-sopco3.adb: Likewise. * libgnat/s-sopco3.ads: Likewise. * libgnat/s-sopco4.adb: Likewise. * libgnat/s-sopco4.ads: Likewise. * libgnat/s-sopco5.adb: Likewise. * libgnat/s-sopco5.ads: Likewise. * libgnat/s-spsufi.ads: Likewise. * libgnat/s-stache.adb: Likewise. * libgnat/s-stache.ads: Likewise. * libgnat/s-stalib.adb: Likewise. * libgnat/s-stalib.ads: Likewise. * libgnat/s-stoele.adb: Likewise. * libgnat/s-stoele.ads: Likewise. * libgnat/s-strcom.adb: Likewise. * libgnat/s-strcom.ads: Likewise. * libgnat/s-strhas.adb: Likewise. * libgnat/s-string.adb: Likewise. * libgnat/s-string.ads: Likewise. * libgnat/s-strops.adb: Likewise. * libgnat/s-strops.ads: Likewise. * libgnat/s-ststop.adb: Likewise. * libgnat/s-ststop.ads: Likewise. * libgnat/s-traceb.adb: Likewise. * libgnat/s-traceb.ads: Likewise. * libgnat/s-traent.adb: Likewise. * libgnat/s-traent.ads: Likewise. * libgnat/s-utf_32.adb: Likewise. * libgnat/s-unstyp.ads: Likewise. * libgnat/s-wchcnv.adb: Likewise. * libgnat/s-wchcnv.ads: Likewise. * libgnat/s-wchcon.adb: Likewise. * libgnat/s-wchcon.ads: Likewise. * libgnat/s-wchjis.adb: Likewise. * libgnat/s-wchjis.ads: Likewise.
2021-12-28docs: replace http:// with https://Martin Liska1-2/+2
I replaced and verified http:// links for various domains. gcc/ada/ChangeLog: * doc/share/gnu_free_documentation_license.rst: Replace http:// with https. * gnat-style.texi: Likewise. * gnat_rm.texi: Likewise. * gnat_ugn.texi: Likewise. gcc/d/ChangeLog: * gdc.texi: Replace http:// with https. gcc/ChangeLog: * doc/contrib.texi: Replace http:// with https. * doc/contribute.texi: Likewise. * doc/extend.texi: Likewise. * doc/gccint.texi: Likewise. * doc/gnu.texi: Likewise. * doc/implement-c.texi: Likewise. * doc/implement-cxx.texi: Likewise. * doc/include/fdl.texi: Likewise. * doc/include/gpl_v3.texi: Likewise. * doc/install.texi: Likewise. * doc/invoke.texi: Likewise. * doc/passes.texi: Likewise. * doc/service.texi: Likewise. * doc/sourcebuild.texi: Likewise. * doc/standards.texi: Likewise. gcc/fortran/ChangeLog: * gfortran.texi: Replace http:// with https. * intrinsic.texi: Likewise. gcc/go/ChangeLog: * gccgo.texi: Replace http:// with https. gcc/jit/ChangeLog: * docs/_build/texinfo/libgccjit.texi: Replace http:// with https. * docs/cp/index.rst: Likewise. * docs/cp/intro/index.rst: Likewise. * docs/cp/intro/tutorial01.rst: Likewise. * docs/cp/intro/tutorial02.rst: Likewise. * docs/cp/intro/tutorial03.rst: Likewise. * docs/cp/intro/tutorial04.rst: Likewise. * docs/cp/topics/asm.rst: Likewise. * docs/cp/topics/compilation.rst: Likewise. * docs/cp/topics/contexts.rst: Likewise. * docs/cp/topics/expressions.rst: Likewise. * docs/cp/topics/functions.rst: Likewise. * docs/cp/topics/index.rst: Likewise. * docs/cp/topics/locations.rst: Likewise. * docs/cp/topics/objects.rst: Likewise. * docs/cp/topics/types.rst: Likewise. * docs/index.rst: Likewise. * docs/internals/index.rst: Likewise. * docs/intro/index.rst: Likewise. * docs/intro/tutorial01.rst: Likewise. * docs/intro/tutorial02.rst: Likewise. * docs/intro/tutorial03.rst: Likewise. * docs/intro/tutorial04.rst: Likewise. * docs/intro/tutorial05.rst: Likewise. * docs/topics/asm.rst: Likewise. * docs/topics/compatibility.rst: Likewise. * docs/topics/compilation.rst: Likewise. * docs/topics/contexts.rst: Likewise. * docs/topics/expressions.rst: Likewise. * docs/topics/function-pointers.rst: Likewise. * docs/topics/functions.rst: Likewise. * docs/topics/index.rst: Likewise. * docs/topics/locations.rst: Likewise. * docs/topics/objects.rst: Likewise. * docs/topics/performance.rst: Likewise. * docs/topics/types.rst: Likewise.
2021-12-02[Ada] Cleanups related to expansion of dispatching primitivesPiotr Trojanek1-1/+1
gcc/ada/ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst (No_Dispatching_Calls): Fix whitespace in example code. * gnat_rm.texi: Regenerate. * exp_ch13.adb (Expand_N_Freeze_Entity): Replace low-level membership test with a high-level wrapper. * exp_ch3.adb (Expand_Freeze_Record_Type): Remove unnecessary initialization of list of wrapper declarations and unnecessary guard for list of their bodies (if no bodies are created then Append_Freeze_Actions is a no-op).
2021-12-01[Ada] Allow formal functions to have a default in the form of an expression ↵Gary Dismukes1-0/+24
function gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Add documentation of the new form of formal subprogram default in the section on language extensions (pragma Extensions_Allowed). * gnat_rm.texi: Regenerate. * gen_il-gen-gen_nodes.adb: Add Expression as a syntactic field of N_Formal_(Abstract|Concrete)_Subprogram_Declaration nodes. * par-ch12.adb (P_Formal_Subprogram_Declaration): Add parsing support for the new default of a parenthesized expression for formal functions. Issue an error when extensions are not allowed, suggesting use of -gnatX. Update comment with extended syntax for SUBPROGRAM_DEFAULT. * sem_ch12.adb (Analyze_Formal_Subprogram_Declaration): Issue an error when an expression default is given for an abstract formal function. When a default expression is present for a formal function, install the function's formals and preanalyze the expression. (Instantiate_Formal_Subprogram): Fix typo in RM paragraph in a comment. When a formal function has a default expression, create a body for the function that will evaluate the expression and will be called when the default applies in an instantiation. The implicit function is marked as inlined and as having convention Intrinsic.
2021-12-01[Ada] Document System.Atomic_Counters as supported on ARM and AARCH64Piotr Trojanek1-1/+1
gcc/ada/ * doc/gnat_rm/the_gnat_library.rst (System.Atomic_Counters): Sync description with comment in s-atocou.ads. * gnat-style.texi, gnat_rm.texi, gnat_ugn.texi: Regenerate.
2021-11-09[Ada] Improve integration of strub with type systemsAlexandre Oliva1-14/+46
gcc/ada/ * strub.adb, strub.ads: New files. * exp_attr.adb (Access_Cases): Copy strub mode to subprogram type. * exp_disp.adb (Expand_Dispatching_Call): Likewise. * freeze.adb (Check_Inherited_Conditions): Check that strub modes match overridden subprograms and interfaces. (Freeze_All): Renaming declarations too. * sem_attr.adb (Resolve_Attribute): Reject 'Access to strub-annotated data object. * sem_ch3.adb (Derive_Subprogram): Copy strub mode to inherited subprogram. * sem_prag.adb (Analyze_Pragma): Propagate Strub Machine_Attribute from access-to-subprogram to subprogram type when required, but not from access-to-data to data type. Mark the entity that got the pragma as having a gigi rep item. * sem_res.adb (Resolve): Reject implicit conversions that would change strub modes. (Resolve_Type_Conversions): Reject checked conversions between incompatible strub modes. * doc/gnat_rm/security_hardening_features.rst: Update. * gnat_rm.texi: Regenerate. * libgnat/a-except.ads (Raise_Exception): Revert strub-callable annotation in public subprogram. * libgnat/s-arit128.ads (Multiply_With_Ovflo_Check128): Likewise. * libgnat/s-arit64.ads (Multiply_With_Ovflo_Check64): Likewise. * libgnat/s-secsta.ads (SS_Allocate): Likewise. (SS_Mark, SS_Release): Likewise. * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add ada/strub.o.
2021-11-09[Ada] Document the SuSE kernel bugTom Tromey1-0/+17
gcc/ada/ * doc/gnat_ugn/platform_specific_information.rst: Document the SuSE kernel bug. * gnat_ugn.texi: Regenerate.
2021-10-30Implied compares in Ada Harded Conditionals documentationAlexandre Oliva1-3/+4
Improve the wording on optimizations that prevent compare hardening, so as to also cover cases in which explicit compares get combined into operations with implied compares. for gcc/ada/ChangeLog * doc/gnat_rm/security_hardening_features.rst: Mention optimization to operations with implied compares.
2021-10-28hardened conditionalsAlexandre Oliva1-0/+40
This patch introduces optional passes to harden conditionals used in branches, and in computing boolean expressions, by adding redundant tests of the reversed conditions, and trapping in case of unexpected results. Though in abstract machines the redundant tests should never fail, CPUs may be led to misbehave under certain kinds of attacks, such as of power deprivation, and these tests reduce the likelihood of going too far down an unexpected execution path. for gcc/ChangeLog * common.opt (fharden-compares): New. (fharden-conditional-branches): New. * doc/invoke.texi: Document new options. * gimple-harden-conditionals.cc: New. * Makefile.in (OBJS): Build it. * passes.def: Add new passes. * tree-pass.h (make_pass_harden_compares): Declare. (make_pass_harden_conditional_branches): Declare. for gcc/ada/ChangeLog * doc/gnat_rm/security_hardening_features.rst (Hardened Conditionals): New. for gcc/testsuite/ChangeLog * c-c++-common/torture/harden-comp.c: New. * c-c++-common/torture/harden-cond.c: New.
2021-10-25[Ada] Relax INOX restrictions when casing on composite value.Steve Baird1-3/+18
gcc/ada/ * sem_case.adb (Composite_Case_Ops.Box_Value_Required): A new function which takes a component type and returns a Boolean. Returns True for the cases which were formerly forbidden as components (these checks were formerly performed in the now-deleted procedure Check_Composite_Case_Selector.Check_Component_Subtype). (Composite_Case_Ops.Normalized_Case_Expr_Type): Hoist this function out of the Array_Case_Ops package because it has been generalized to also do the analogous thing in the case of a discriminated type. (Composite_Case_Ops.Scalar_Part_Count): Return 0 if Box_Value_Required returns True for the given type/subtype. (Composite_Case_Ops.Choice_Analysis.Choice_Analysis.Component_Bounds_Info. Traverse_Discrete_Parts): Return without doing anything if Box_Value_Required returns True for the given type/subtype. (Composite_Case_Ops.Choice_Analysis.Parse_Choice.Traverse_Choice): If Box_Value_Required yields True for a given component type, then check that the value of that component in a choice expression is indeed a box (in which case the component is ignored). * doc/gnat_rm/implementation_defined_pragmas.rst: Update documentation. * gnat_rm.texi: Regenerate.
2021-10-20[Ada] Warning on nonmatching subtypes in fully conforming subprogram specs ↵Gary Dismukes1-0/+19
and bodies gcc/ada/ * sem_ch6.adb: Add with and use of Warnsw. (Check_Conformance): Report a warning when subtypes or designated subtypes of formal parameters or result subtypes denote different declarations between the spec and body of the (Subprogram_Subtypes_Have_Same_Declaration): New function nested within Check_Conformance that determines whether two subtype entities referenced in a subprogram come from the same declaration. Returns True immediately if the subprogram is in a generic instantiation, or the subprogram is marked Is_Internal or is declared in an internal (GNAT library) unit, or GNAT_Mode is enabled, otherwise compares the nonlimited views of the entities (or their designated subtypes' nonlimited views in the anonymous access cases). (Nonlimited_View_Of_Subtype): New function nested within function Subprogram_Subtypes_Have_Same_Declaration that returns Non_Limited_View of a type or subtype that is an incomplete or class-wide type that comes from a limited of a package (From_Limited_With is True for the entity), or returns Full_View when the nonlimited view is an incomplete type. Otherwise returns the entity passed in. * warnsw.ads (Warn_On_Pedantic_Checks): New warning flag. (type Warning_Record): New component Warn_On_Pedantic_Checks. * warnsw.adb (All_Warnings): Set Warn_On_Pedantic_Checks from parameter Setting. (Restore_Warnings): Restore the value of the Warn_On_Pedantic_Checks flag. (Save_Warnings): Save the value of the Warn_On_Pedantic_Checks flag. (Set_Underscore_Warning_Switch): Add settings of the Warn_On_Pedantic flag according to the switch ("-gnatw_p" vs. "-gnatw_P"). * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add documentation of new switches -gnatw_p and -gnatw_P (warnings for pedantic checks). * gnat_ugn.texi: Regenerate. * usage.adb: Add Warn_On_Pedantic_Checks.
2021-10-05[Ada] introduce stack scrub (strub) featureAlexandre Oliva3-0/+93
gcc/ada/ * doc/gnat_rm.rst: Add... * doc/gnat_rm/security_hardening_features.rst: New. * doc/gnat_rm/about_this_guide.rst: Link to new chapter. * gnat_rm.texi: Regenerate. * gcc-interface/utils.c (handle_strub_attribute): New. (gnat_internal_attribute_table): Add strub. * libgnat/a-except.adb: Make Rcheck_CE_* strub-callable. * libgnat/a-except.ads (Raise_Exception): Likewise. (Raise_Exception_Always): Likewise. * libgnat/s-arit128.ads (Multiply_With_Ovflo_Check128): Likewise. * libgnat/s-arit64.ads (Multiply_With_Ovflo_Check64): Likewise. * libgnat/s-secsta.ads (SS_Allocate, SS_Mark, SS_Release): Likewise.
2021-10-05[Ada] Forbids use of Compile_Time_(Error|Warning) as configuration pragmaEtienne Servais2-52/+41
gcc/ada/ * sem_prag.adb (Analyze_Pragma): Forbid use of Compile_Time_(Error|Warning) as configuration pragma. * doc/gnat_ugn/the_gnat_compilation_model.rst: Compile_Time_(Error|Warning) and Compiler_Unit(_Warning) are not configuration pragmas and shall not be listed as such. The following pragmas are either obsolete or undocumented: No_Run_Time, Propagate_Exceptions, Rational, Ravenscar, Restricted_Run_Time, Short_Descriptors, Universal_Data. Fix some typos (notably on Restriction_Warnings). * doc/gnat_rm/implementation_defined_pragmas.rst: Move Rename_Pragma documentation to alphabetical order. * gnat_rm.texi, gnat_ugn.texi: Regenerate.
2021-10-04[Ada] Incremental patch for restriction No_Dynamic_Accessibility_ChecksJustin Squirek1-0/+38
gcc/ada/ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Add new entry for No_Dynamic_Accessibility_Checks documenting behavior. * gnat_rm.texi: Regenerate. * exp_ch4.adb (Expand_N_In): Perform special expansion for membership tests when No_Dynamic_Accessibility_Checks is active. * sem_attr.adb (Resolve_Attribute): Skip static accessibility check on actuals for anonymous access type formal parameters, and add constants for readability. * sem_util.adb (Function_Call_Or_Allocator_Level): Use the innermost master for determining the level for function calls within the alternative accessibility model. (Type_Access_Level): Properly get the level for anonymous access function result types.
2021-10-04[Ada] Document the current behaviour of -gnateA switchPiotr Trojanek1-3/+4
gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (gnateA): This switch no longer looks at the formal parameter type being composite (as originally mandated by SPARK), but in the parameter passing mechanism being not specified (as currently mandated by Ada). * gnat_ugn.texi: Regenerate.
2021-10-04[Ada] Adjust documentation of -fdump-ada-spec in GNAT UGEric Botcazou1-40/+12
gcc/ada/ * doc/gnat_ugn/the_gnat_compilation_model.rst (Binding generation): Document specific behavior for /include/-ending paths and update. * gnat_ugn.texi: Regenerate.
2021-10-01[Ada] Document rounding mode assumed for dynamic floating-point computationsEric Botcazou1-6/+6
gcc/ada/ * doc/gnat_rm/implementation_defined_characteristics.rst: Document the rounding mode assumed for dynamic computations as per 3.5.7(16). * gnat_rm.texi: Regenerate.
2021-10-01[Ada] Document that gnatmem requires fixed-position executablesEric Botcazou1-6/+8
gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst (gnatmem): Document that it works only with fixed-position executables.
2021-09-23[Ada] Adjust documentation of gnatsymbolizeEric Botcazou1-10/+8
gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst (gnatsymbolize): Document new --load option and -g1 as minimal compilation requirement.
2021-09-23[Ada] Update "Implementation Defined Characteristics" documentation.Steve Baird1-311/+379
gcc/ada/ * doc/gnat_rm/implementation_defined_characteristics.rst: Update this section to reflect the current version of Ada RM M.2. * gnat_rm.texi: Regenerate.
2021-09-22[Ada] Minor doc improvementArnaud Charlet1-1/+4
gcc/ada/ * doc/gnat_ugn/platform_specific_information.rst: Improve doc on permission and containers. * gnat_ugn.texi: Regenerate.
2021-09-22[Ada] Add -gnatX support for casing on array valuesSteve Baird1-3/+11
gcc/ada/ * exp_ch5.adb (Expand_General_Case_Statement.Pattern_Match): Add new function Indexed_Element to handle array element comparisons. Handle case choices that are array aggregates, string literals, or names denoting constants. * sem_case.adb (Composite_Case_Ops.Array_Case_Ops): New package providing utilities needed for casing on arrays. (Composite_Case_Ops.Choice_Analysis): If necessary, include array length as a "component" (like a discriminant) when traversing components. We do not (yet) partition choice analysis to deal with unequal length choices separately. Instead, we embed everything in the minimum-dimensionality Cartesian product space needed to handle all choices properly; this is determined by the length of the longest choice pattern. (Composite_Case_Ops.Choice_Analysis.Traverse_Discrete_Parts): Include length as a "component" in the traversal if necessary. (Composite_Case_Ops.Choice_Analysis.Parse_Choice.Traverse_Choice): Add support for case choices that are string literals or names denoting constants. (Composite_Case_Ops.Choice_Analysis): Include length as a "component" in the analysis if necessary. (Check_Choices.Check_Case_Pattern_Choices.Ops.Value_Sets.Value_Index_Count): Improve error message when capacity exceeded. * doc/gnat_rm/implementation_defined_pragmas.rst: Update documentation to reflect current implementation status. * gnat_rm.texi: Regenerate.
2021-09-14Implement PR ada/101385Eric Botcazou1-4/+7
For consistency's sake with -Wall & -w, this makes -Werror imply -gnatwe. gcc/ada/ PR ada/101385 * doc/gnat_ugn/building_executable_programs_with_gnat.rst (-Wall): Minor fixes. (-w): Likewise. (-Werror): Document that it also sets -gnatwe by default. * gcc-interface/lang-specs.h (ada): Expand -gnatwe if -Werror is passed and move expansion of -gnatw switches to before -gnatez.
2021-07-09[Ada] Add -gnatX support for casing on discriminated valuesSteve Baird1-6/+5
gcc/ada/ * exp_ch5.adb (Expand_General_Case_Statement): Add new function Else_Statements to handle the case of invalid data analogously to how it is handled when casing on a discrete value. * sem_case.adb (Has_Static_Discriminant_Constraint): A new Boolean-valued function. (Composite_Case_Ops.Scalar_Part_Count): Include discriminants when traversing components. (Composite_Case_Ops.Choice_Analysis.Traverse_Discrete_Parts): Include discriminants when traversing components; the component range for a constrained discriminant is a single value. (Composite_Case_Ops.Choice_Analysis.Parse_Choice): Eliminate Done variable and modify how Next_Part is computed so that it is always correct (as opposed to being incorrect when Done is True). This includes changes in Update_Result (a local procedure). Add new local procedure Update_Result_For_Box_Component and call it not just for box components but also for "missing" components (components associated with an inactive variant). (Check_Choices.Check_Composite_Case_Selector.Check_Component_Subtype): Instead of disallowing all discriminated component types, allow those that are unconstrained or statically constrained. Check discriminant subtypes along with other component subtypes. * doc/gnat_rm/implementation_defined_pragmas.rst: Update documentation to reflect current implementation status. * gnat_rm.texi: Regenerate.