aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/doc
AgeCommit message (Collapse)AuthorFilesLines
2019-08-20[Ada] Minor reformattingsGary Dismukes2-3/+3
2019-08-20 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * ali.adb, ali.ads, aspects.adb, checks.ads, checks.adb, doc/gnat_rm/implementation_defined_pragmas.rst, doc/gnat_ugn/building_executable_programs_with_gnat.rst, einfo.ads, exp_aggr.adb, exp_ch11.adb, exp_ch3.ads, exp_ch4.adb, exp_disp.adb, inline.adb, libgnat/a-locale.ads, libgnat/s-soflin.ads, par_sco.adb, repinfo.adb, sem_ch5.adb, sem_disp.adb, sem_elab.adb, sem_eval.adb, sem_spark.adb, sem_spark.ads, sinfo.ads: Minor reformattings, typo fixes and and rewordings. From-SVN: r274737
2019-08-20[Ada] New pragma Aggregate_Individually_AssignPatrick Bernardi1-0/+15
Where possible GNAT will store the binary representation of a record aggregate in memory for space and performance reasons. This configuration pragma changes this behaviour so that record aggregates are instead always converted into individual assignment statements. The following package pack.ads: -- pack.ads pragma Aggregate_Individually_Assign; pragma Restrictions (No_Multiple_Elaboration); package Pack is type A_Rec is record A, B, C, D : Boolean; end record; A : A_Rec := (True, False, True, True); end Pack; when compiled with gcc -c -gnatdg pack.ads should produce the following output: Source recreated from tree for Pack (spec) ------------------------------------------ pragma aggregate_individually_assign; pragma restrictions (no_multiple_elaboration); package pack is type pack__a_rec is record a : boolean; b : boolean; c : boolean; d : boolean; end record; freeze pack__a_rec [ procedure pack__a_recIP (_init : out pack__a_rec) is begin %push_constraint_error_label () %push_program_error_label () %push_storage_error_label () null; %pop_constraint_error_label %pop_program_error_label %pop_storage_error_label return; end pack__a_recIP; ] pack__a : pack__a_rec := ( a => true, b => false, c => true, d => true); pack__a.a := true; pack__a.b := false; pack__a.c := true; pack__a.d := true; null; end pack; 2019-08-20 Patrick Bernardi <bernardi@adacore.com> gcc/ada/ * exp_aggr.adb (Expand_Record_Aggregate): Always convert a record Aggregate to assignment statements if the option Aggregate_Individually_Assign is set. * opt.ads (Aggregate_Individually_Assign): New option. * par-prag.adb (Prag): Add Pragma_Aggregate_Individually_Assign. * sem_prag.adb (Analyze_Pragma): Likewise. * snames.ads-tmpl: Add Pragma_Aggregate_Individually_Assign and Name_Aggregate_Individually_Assign. * doc/gnat_rm/implementation_defined_pragmas.rst: Document pragma Aggregate_Individually_Assign. * gnat_rm.texi: Regenerate. From-SVN: r274730
2019-08-20[Ada] Warning for out-of-order record representation clausesBob Duff1-2/+21
The compiler can now warn for out-of-order record representation clauses. A warning is given if the order of component declarations, component clauses, and bit-level layout do not all agree. The warning is disabled by default, and may be enabled by the -gnatw_r switch. 2019-08-20 Bob Duff <duff@adacore.com> gcc/ada/ * sem_ch13.adb (Component_Order_Check): New procedure to check for out-of-order clauses. * warnsw.ads, warnsw.adb: New -gnatw_r switch. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document new switch. * gnat_ugn.texi: Regenerate. From-SVN: r274723
2019-08-20[Ada] Pragma Warning_As_Error works for style warningsBob Duff1-11/+14
Pragma Warning_As_Error now works for style warnings (messages that start with "(style)", enabled by -gnaty) the same way it works for regular warnings enabled by -gnatw. The following test should fail to build with style checks: gnat.adc: pragma Warning_As_Error ("two spaces required"); style.adb: procedure Style is X : Integer; begin null; --Hello end; gnatmake -q -f -g style.adb -gnaty should get: style.adb:2:04: warning: variable "X" is never read and never assigned style.adb:5:06: error: (style) two spaces required [warning-as-error] style.adb:6:01: (style) "end Style" required gnatmake: "style.adb" compilation error and no executable should be created. 2019-08-20 Bob Duff <duff@adacore.com> gcc/ada/ * errout.adb (Error_Msg_Internal): Set Warn_Err in case of Is_Style_Msg. * erroutc.adb (Output_Msg_Text): Do Warnings_Treated_As_Errors processing and [warning-as-error] modification for style messages. Clean up code, simplify, remove unnecessary block statement, add renaming of table entry. * erroutc.ads (Warning_Treated_As_Error): Fix comment: no such thing as Set_Warning_As_Error. * opt.ads: Clean up comments and move related declarations near each other. * par-prag.adb: Process Warning_As_Error. This is necessary because many style warning happen during parsing. * sem_prag.adb: Use new Acquire_Warning_Match_String. * sem_util.ads, sem_util.adb (Acquire_Warning_Match_String): New function shared by par-prag.adb and sem_prag.adb. Replaces the procedure in sem_prag.adb. Avoid use of global variables. * stringt.ads, stringt.adb (To_String): New function to convert String_Id to String. * doc/gnat_rm/implementation_defined_pragmas.rst: Document the new feature. * gnat_rm.texi: Regenerate. From-SVN: r274721
2019-08-20[Ada] Document requirements for Pragma Lock_FreeArnaud Charlet1-0/+18
2019-08-20 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Document requirements for Pragma Lock_Free. * gnat_rm.texi: Regenerate. From-SVN: r274717
2019-08-19[Ada] Fix documentation for stream oriented attributesBob Duff1-14/+14
2019-08-19 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_advice.rst: Fix documentation for stream oriented attributes. * gnat_rm.texi: Regenerate. From-SVN: r274666
2019-08-19[Ada] Document missing gnatmetric switchesBob Duff1-1/+56
2019-08-19 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Document missing metrics switches. From-SVN: r274646
2019-08-14[Ada] Alignment may be specified as zeroBob Duff1-20/+22
An Alignment clause or an aspect_specification for Alignment may be specified as 0, which is treated the same as 1. 2019-08-14 Bob Duff <duff@adacore.com> gcc/ada/ * sem_ch13.adb (Get_Alignment_Value): Return 1 for Alignment 0, and do not give an error. * doc/gnat_rm/representation_clauses_and_pragmas.rst: Update the corresponding documentation. * gnat_rm.texi: Regenerate. gcc/testsuite/ * gnat.dg/alignment15.adb: New testcase. From-SVN: r274473
2019-08-14[Ada] Warn about unknown condition in Compile_Time_WarningBob Duff1-1/+25
The compiler now warns if the condition in a pragma Compile_Time_Warning or Compile_Time_Error does not have a compile-time-known value. The warning is not given for pragmas in a generic template, but is given for pragmas in an instance. The -gnatw_c and -gnatw_C switches turn the warning on and off. The default is on. 2019-08-14 Bob Duff <duff@adacore.com> gcc/ada/ * sem_prag.ads, sem_prag.adb (Process_Compile_Time_Warning_Or_Error): In parameterless version, improve detection of whether we are in a generic unit to cover the case of an instance within a generic unit. (Process_Compile_Time_Warning_Or_Error): Rename the two-parameter version to be Validate_Compile_Time_Warning_Or_Error, and do not export it. Issue a warning if the condition is not known at compile time. The key point is that the warning must be given only for pragmas deferred to the back end, because the back end discovers additional values that are known at compile time. Previous changes in this ticket have enabled this by deferring to the back end without checking for special cases such as 'Size. (Validate_Compile_Time_Warning_Or_Error): Rename to be Defer_Compile_Time_Warning_Error_To_BE. * warnsw.ads, warnsw.adb (Warn_On_Unknown_Compile_Time_Warning): Add new switches -gnatw_c and -gnatw_C to control the above warning. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document new switches. * gnat_ugn.texi: Regenerate. gcc/testsuite/ * gnat.dg/warn27.adb: New testcase. From-SVN: r274469
2019-08-14[Ada] Remove documentation of gnatelimArnaud Charlet1-267/+2
2019-08-14 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_and_program_execution.rst: Remove documentation of gnatelim. From-SVN: r274462
2019-08-13[Ada] Add/fix documentation for the Double_*_Alignment parametersEric Botcazou1-4/+6
2019-08-13 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (-gnateT): Document Double_Float_Alignment parameter and fix description of Double_Scalar_Alignment parameter. * gnat_ugn.texi: Regenerate. From-SVN: r274337
2019-08-12[Ada] Remove doc for language version switchesBob Duff1-62/+33
Remove documentation for Ada language version switches, and note that they are no longer needed. These tools now silently ignore such switches, and process the file correctly no matter what version of Ada is used. 2019-08-12 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst (gnatmetric, gnatpp, gnatstub): Remove documentation for Ada language version switches, and note that they are no longer needed. From-SVN: r274299
2019-08-12[Ada] New aspect/pragma No_Caching for analysis of volatile dataYannick Moy2-0/+21
A new aspect/pragma can be attached to volatile variables to indicate that such a variable is not used for interactions with the external world, but only that accesses to that variable should not be optimized by the compiler. This is in particular useful for guarding against fault injection. SPARK Reference manual has been updated to allow this use of volatile data, see section 7.1.2, so that GNATprove can analyze such variables as not volatile. 2019-08-12 Yannick Moy <moy@adacore.com> gcc/ada/ * aspects.adb, aspects.ads (Aspect_No_Caching): New aspect. * contracts.adb, contracts.ads (Add_Contract_Item): Add handling of No_Caching. (Analyze_Object_Contract): Add handling of No_Caching. * einfo.adb, einfo.ads (Get_Pragma): Add handling of No_Caching. * doc/gnat_rm/implementation_defined_aspects.rst, doc/gnat_rm/implementation_defined_pragmas.rst: Document new aspect/pragma. * gnat_rm.texi: Regenerate. * par-prag.adb (Prag): New pragma Pragma_No_Caching. * sem_ch13.adb (Analyze_Aspect_Specifications, Check_Aspect_At_Freeze_Point): Add handling of No_Caching. * sem_prag.adb (Analyze_Pragma): Deal with pragma No_Caching. * sem_prag.ads (Analyze_External_Property_In_Decl_Part): Now applies to No_Caching. * sem_util.adb, sem_util.ads (Is_Effectively_Volatile): Add handling of No_Caching. (No_Caching_Enabled): New query function. * snames.ads-tmpl: New names for pragma. gcc/testsuite/ * gnat.dg/no_caching.adb, gnat.dg/no_caching.ads: New testcase. From-SVN: r274292
2019-07-11[Ada] Minimal binderPatrick Bernardi1-1/+10
The new minimal binder option ("-minimal") suppresses the generation of binder objects that are not strictly required for program operation. This option is suitable for space constrained applications and comes with the restriction that programs can no longer be debugged using GDB. 2019-07-11 Patrick Bernardi <bernardi@adacore.com> gcc/ada/ * bindgen.adb (Gen_Main): Do not generate a reference to Ada_Main_Program_Name when the Minimal_Binder flag is set. (Gen_Output_File_Ada): Do not output GNAT_Version and Ada_Main_Program_Name info if Minimal_Binder flag is set. * bindusg.adb: Add documentation for new -minimal switch. * gnatbind.adb (Scan_Bind_Arg): Scan -minimal switch. * opt.ads: Add new global flag Minimal_Binder to indicate if the binder should not produce global variables. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update documentation with new binder -minimal switch. * gnat_ugn.texi: Regenerate. From-SVN: r273401
2019-07-11[Ada] Fix inconsistent documentation for gnatmetricBob Duff1-47/+43
One part said all metrics are enabled by default (which is now true), and another part said the coupling metrics are disabled by default (which is no longer true). 2019-07-11 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Fix inconsistent documentation for gnatmetric. * gnat_ugn.texi: Regenerate. From-SVN: r273391
2019-07-11[Ada] Document gnatpp's --spaces-only switchBob Duff1-0/+6
2019-07-11 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Document gnatpp's --spaces-only switch. From-SVN: r273390
2019-07-10[Ada] Improve gnatmem's doc for the depth switchArnaud Charlet1-8/+9
2019-07-10 Arnaud Charlet <charlet@adacore.com> gcc/ada * doc/gnat_ugn/gnat_and_program_execution.rst: Improve gnatmem's doc for the depth switch. From-SVN: r273346
2019-07-10[Ada] GNATpp: document the --source-line-breaks switchBob Duff1-0/+8
2019-07-10 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Document gnatpp's --source-line-breaks switch. From-SVN: r273345
2019-07-10[Ada] Documentation of Img attribute out of dateJustin Squirek2-7/+7
2019-07-10 Justin Squirek <squirek@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst: Add mention of 'Image attribute with 'Img's entry to mention additional added 2012 usage of Obj'Image. * doc/gnat_rm/implementation_defined_pragmas.rst: Correct mispelling of Async_Writers. * gnat_rm.texi: Regenerate. * sem_prag.adb (Analyze_Pragma): Correct mispelling of Async_Writers. * sem_util.adb (State_Has_Enabled_Property): Correct mispelling of Async_Writers. From-SVN: r273344
2019-07-10[Ada] Improve support for tuning branch probability heuristicsEric Botcazou1-0/+11
This adds a new GNAT.Branch_Prediction package to make it possible to tune the branch probability heuristics more finely. This package contains the equivalent of __builtin_expect in C/C++ plus a couple of specializations. The following program gives a summary of the usage: package Q is I : Integer; pragma Volatile (I); end Q; with GNAT.Branch_Prediction; use GNAT.Branch_Prediction; with Text_IO; use Text_IO; with Q; use Q; procedure P is begin if Unlikely (I = 0) then Put_Line ("Zero was passed"); return; end if; if Likely (I > 0) then Put_Line ("A positive number was passed"); else Put_Line ("A negative number was passed"); end if; if Expect ((I rem 2) = 0, False) then Put_Line ("An even number was passed"); else Put_Line ("An odd number was passed"); end if; end; 2019-07-10 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add g-brapre. * libgnat/g-brapre.ads: New package specification. * doc/gnat_rm/the_gnat_library.rst: Document it. * gnat_rm.texi: Regenerate. From-SVN: r273340
2019-07-10[Ada] GNAT RM: add note about debuggers for Scalar_Storage_OrderEric Botcazou1-8/+11
2019-07-10 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst (Scalar_Storage_Order): Minor tweaks. Add note about debuggers. * gnat_rm.texi: Regenerate. From-SVN: r273337
2019-07-09[Ada] Warning needed on anonymous access type allocatorsJustin Squirek1-0/+23
This patch enhances the compiler to add an optional warning for allocators of anonymous access types due to the somewhat confusing runtime accessibility checks that they generate. For more details see RM 3.10.2 sections 14/3, 14.1/3, and 14.2/3. These warnings can now be enabled with -gnatw_a, disabled with -gnatw_A and are part of the "all warnings" flag -gnatwa. ------------ -- Source -- ------------ -- main.adb procedure Main is type Int_Ptr is access all Integer; Ptr_Obj : Int_Ptr; Ptr_Not_Null_Obj : not null Int_Ptr := new Integer; Ptr_Anon_Acc_Obj : not null access Integer := new Integer; -- WARNING procedure Update_Ptr (Item : access Integer) is begin Ptr_Obj := Int_Ptr (Item); -- RUNTIME ERROR end; procedure Update_Ptr_With_Anonymous_Allocator is Item : access Integer := new Integer; begin Update_Ptr (Item); end; type Rec_With_Coextension_A (Disc : access Integer) is null record; type Rec_With_Coextension_B (Disc : access Integer) is record Comp : Integer; end record; Obj : Rec_With_Coextension_A := (Disc => new Integer'(32)); -- WARNING procedure Test_Param (Param : access Integer) is begin null; end; function Test_Simple_Return return access Integer is begin return new Integer; -- WARNING end; function Test_Coextension_Return_A return Rec_With_Coextension_A is begin return (Disc => new Integer); -- WARNING end; function Test_Coextension_Return_B return Rec_With_Coextension_B is begin return (new Integer, 32); -- WARNING end; begin Test_Param (new Integer); -- WARNING Test_Param (Param => new Integer); -- WARNING Update_Ptr_With_Anonymous_Allocator; end; ----------------- -- Compilation -- ----------------- $ gnatmake -q -gnatw_a main.adb $ rm *.ali $ gnatmake -q -gnatwa -gnatw_A main.adb $ rm *.ali $ gnatmake -q -gnatwa main.adb $ main main.adb:8:06: warning: use of an anonymous access type allocator main.adb:16:32: warning: use of an anonymous access type allocator main.adb:29:15: warning: use of an anonymous access type allocator main.adb:38:14: warning: use of an anonymous access type allocator main.adb:43:23: warning: coextension will not be deallocated when its associated owner is deallocated main.adb:43:23: warning: use of an anonymous access type allocator main.adb:48:15: warning: coextension will not be deallocated when its associated owner is deallocated main.adb:48:15: warning: use of an anonymous access type allocator main.adb:52:16: warning: use of an anonymous access type allocator main.adb:53:25: warning: use of an anonymous access type allocator main.adb:5:04: warning: variable "Ptr_Obj" is assigned but never read main.adb:6:04: warning: variable "Ptr_Not_Null_Obj" is not referenced main.adb:7:04: warning: variable "Ptr_Anon_Acc_Obj" is not referenced main.adb:16:07: warning: "Item" is not modified, could be declared constant main.adb:28:04: warning: variable "Obj" is not referenced main.adb:36:13: warning: function "Test_Simple_Return" is not referenced main.adb:41:13: warning: function "Test_Coextension_Return_A" is not referenced main.adb:43:23: warning: coextension will not be deallocated when its associated owner is deallocated main.adb:46:13: warning: function "Test_Coextension_Return_B" is not referenced main.adb:48:15: warning: coextension will not be deallocated when its associated owner is deallocated main.adb:5:04: warning: variable "Ptr_Obj" is assigned but never read main.adb:6:04: warning: variable "Ptr_Not_Null_Obj" is not referenced main.adb:7:04: warning: variable "Ptr_Anon_Acc_Obj" is not referenced main.adb:8:06: warning: use of an anonymous access type allocator main.adb:16:07: warning: "Item" is not modified, could be declared constant main.adb:16:32: warning: use of an anonymous access type allocator main.adb:28:04: warning: variable "Obj" is not referenced main.adb:29:15: warning: use of an anonymous access type allocator main.adb:36:13: warning: function "Test_Simple_Return" is not referenced main.adb:38:14: warning: use of an anonymous access type allocator main.adb:41:13: warning: function "Test_Coextension_Return_A" is not referenced main.adb:43:23: warning: coextension will not be deallocated when its associated owner is deallocated main.adb:43:23: warning: use of an anonymous access type allocator main.adb:46:13: warning: function "Test_Coextension_Return_B" is not referenced main.adb:48:15: warning: coextension will not be deallocated when its associated owner is deallocated main.adb:48:15: warning: use of an anonymous access type allocator main.adb:52:16: warning: use of an anonymous access type allocator main.adb:53:25: warning: use of an anonymous access type allocator raised PROGRAM_ERROR : main.adb:12 accessibility check failed 2019-07-09 Justin Squirek <squirek@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Allocator): Add conditional to detect the presence of anoymous access type allocators and issue a warning if the appropriate warning flag is enabled. * warnsw.ads: Add new warning flag for anonymous allocators * warnsw.adb (All_Warnings, Restore_Warnings, Save_Warnings, Set_Underscore_Warning_Switch): Register new flags. (WA_Warnings): Register new flag as an "all warnings" switch * usage.adb, doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document new warning switches -gnatw_a and -gnatw_A. * gnat_ugn.texi: Regenerate. From-SVN: r273290
2019-07-09[Ada] Reformat commentsPiotr Trojanek1-30/+30
Replace ". " (i.e. a period followed by two spaces) with ". "; this is meant to avoid distraction when reading comments, except for the license section, where apparently this makes the formating nicer. Some comments have been refilled, in particular those that could fit into fewer lines. Also, some occurences of this patter in code has also been removed, e.g. in "J in 1 .. 3". 2019-07-09 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * ali.ads, bindo-graphs.adb, bindo-validators.adb, clean.adb, doc/gnat_ugn/elaboration_order_handling_in_gnat.rst, einfo.ads, exp_aggr.adb, exp_ch13.adb, exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_pakd.adb, fname-uf.ads, gnatlink.adb, inline.adb, lib.ads, make.adb, namet.ads, opt.ads, par-ch4.adb, par-ch6.adb, par-labl.adb, prep.adb, sem_aggr.adb, sem_ch13.adb, sem_ch4.adb, sem_ch5.adb, sem_ch6.adb, sem_ch6.ads, sem_ch7.adb, sem_ch8.adb, sem_dim.adb, sem_disp.adb, sem_prag.adb, sem_res.adb, sem_warn.adb, sinfo.ads: Replace ". " with ". ". Minor reformatting and typo corrections. * gnat_ugn.texi: Generate. From-SVN: r273287
2019-07-09[Ada] Task-related circularities in Elaboration order v4.0Hristian Kirtchev1-0/+17
This patch adds another suggestion to the elaboration order diagnostics. An elaboration circularity involving a task activation may be resolved through pragma Restrictions (No_Entry_Calls_In_Elaboration_Code). ------------ -- Source -- ------------ -- no_entry_calls.txt pragma Restrictions (No_Entry_Calls_In_Elaboration_Code); -- a.ads package A is task type Task_Typ is entry Start; end Task_Typ; procedure Proc; end A; -- a.adb with B; package body A is task body Task_Typ is begin accept Start; B.Proc; end Task_Typ; Elab : Task_Typ; procedure Proc is null; end A; -- b.ads package B is procedure Proc; end B; -- b.adb with A; package body B is procedure Proc is begin A.Proc; end Proc; end B; -- main.adb with A; -- +--> A spec B spec -- | ^ ^ ^ -- | | with | | -- | sbb | +----------------+ | sbb -- | | | | -- | | | Invocation | -- | A body ------------> B body -- | ^ | | -- | | Invocation | | -- | +------------------+ | -- | | -- | Invocation | -- +---------------------------+ -- -- The cycle is: -- -- A body --> A body procedure Main is begin null; end Main; ---------------------------- -- Compilation and output -- ---------------------------- $ gnatmake -f -q main.adb -gnatd_F $ gnatmake -f -q main.adb -gnatec=no_entry_calls.txt error: Elaboration circularity detected info: info: Reason: info: info: unit "a (body)" depends on its own elaboration info: info: Circularity: info: info: unit "a (body)" invokes a construct of unit "a (body)" at elaboration time info: path 1: info: elaboration of unit "a (body)" info: activation of local task declared at "a.ads":2:14 info: call to subprogram "proc" declared at "b.ads":2:14 info: call to subprogram "proc" declared at "a.ads":6:14 info: info: Suggestions: info: info: use pragma Restrictions (No_Entry_Calls_In_Elaboration_Code) info: use the dynamic elaboration model (compiler switch -gnatE) info: gnatmake: *** bind failed. 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * bindo.ads: Move type Precedence_Kind from the private to the visible part of the unit. * bindo-augmentors.adb: Remove the use of global data as it is bad practice. (Augment_Library_Graph): Update the parameter profile. (Is_Visited, Set_Is_Visited): Remove. (Visit_Elaboration_Root, Visit_Elaboration_Roots): Update the parameter profile and comment on usage. (Visit_Vertex): Likewise. Also keep track of which invocation edge activates a task. * bindo-augmentors.ads (Augment_Library_Graph): Update the parameter profile and comment on usage. * bindo-builders.adb (Create_Forced_Edge, Create_Spec_And_Body_Edge, Create_With_Edge): Update the call to Add_Edge. * bindo-diagnostics.adb: Add with end use clauses for Restrict and Rident. (Output_Dynamic_Model_Suggestions): Remove. (Output_Invocation_Related_Suggestions): New routine. (Output_Suggestions): Output all invocation-related suggestions together. * bindo-elaborators.adb: Remove types Comparator_Ptr and Predicate_Ptr. (Find_Best_Vertex): Update the parameter profile. * bindo-graphs.adb (Activates_Task): New routine. (Add_Body_Before_Spec_Edge): Update the call to Add_Edge_With_Return. (Add_Edge): Update the parameter profile and the call to Add_Edge_With_Return. (Add_Edge_With_Return): Update the parameter profile and comment on usage. (At_Least_One_Edge_Satisfies): New routine. (Contains_Elaborate_All_Edge): Reimplement. (Contains_Static_Successor_Edge, Contains_Task_Activation): New routine. (Contains_Weak_Static_Successor): Remove. (Is_Static_Successor_Edge): New routine. * bindo-graphs.ads: Add types LGE_Predicate_Ptr, LGV_Comparator_Ptr, and LGV_Predicate_Ptr. Update type Library_Graph_Edge_Attributes to capture whether an invocation edge activates a task. Update the value of No_Library_Graph_Edge_Attributes. (Activates_Task): Update the parameter profile and comment on usage. (Contains_Static_Successor_Edge, Contains_Task_Activation): New routines. (Contains_Weak_Static_Successor): Remove. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update the documentation to reflect the new task-related advice. * gnat_ugn.texi: Regenerate. From-SVN: r273286
2019-07-09[Ada] Elaboration order v4.0 activationHristian Kirtchev2-897/+574
This patch enables the elaboration order v4.0 as the default elaboration order in GNATbind. The previous v3.0 elaboration order is now referred to as the "legacy elaboration order mechanism" and is available using binder switch -H. 2019-07-09 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * bindo.adb: Remove with and use clauses for Debug. Add with and use clauses for Opt. (Find_Elaboration_Order): Enable the v4.0 elaboration order. The v3.0 mechanism is now available under binder switch -H. * bindusg.adb (Display): Enable switch -H. * debug.adb: Free compiler switch -gnatd_G. Free binder switch -d_N. * sem_elab.adb: Update the section on switches to remove -gnatd_G. (Invocation_Graph_Recording_OK): The invocation graph is now unconditionally recorded in ALI files. * switch-b.adb (Scan_Binder_Switches): Scan switch -H. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the documentation on compiler switches related to elaboration. Update the documentation on binder switches to include switch -H. * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update the documentation on elaboration order handling in GNAT. * gnat_ugn.texi: Regenerate. From-SVN: r273280
2019-07-09[Ada] Reword "wild card" to "wildcard"Piotr Trojanek2-2/+2
2019-07-09 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * doc/gnat_rm/the_gnat_library.rst, doc/gnat_ugn/building_executable_programs_with_gnat.rst, erroutc.adb, libgnat/g-comlin.adb, libgnat/g-comlin.ads, libgnat/g-regexp.ads, libgnat/g-regpat.ads, libgnat/g-spipat.ads, libgnat/s-os_lib.ads, libgnat/s-regexp.ads: Reword "wild card" to "wildcard". * gnat_rm.texi, gnat_ugn.texi: Regenerate. From-SVN: r273272
2019-07-09[Ada] Update -fdump-ada-spec documentationArnaud Charlet1-3/+4
2019-07-09 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * doc/gnat_ugn/the_gnat_compilation_model.rst: Update doc on -fdump-ada-spec now that we generate Ada 2012. * gnat_ugn.texi: Regenerate. From-SVN: r273264
2019-07-08[Ada] GNAT RM: Update documentation on No_Exceptions restrictionArnaud Charlet1-1/+3
2019-07-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Update documentation on No_Exceptions restriction. * gnat_rm.texi: Regenerate. From-SVN: r273224
2019-07-08[Ada] Remove documentation of ignored GNATpp switchBob Duff1-11/+0
2019-07-08 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Remove documentation of ignored GNATpp switch. From-SVN: r273221
2019-07-08[Ada] In-place initialization for Initialize_ScalarsHristian Kirtchev1-46/+75
Update the documentation of pragma Initialize_Scalars in the GNAT Reference Manual. 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Update the documentation of pragma Initialize_Scalars. * gnat_rm.texi: Regenerate. From-SVN: r273220
2019-07-08[Ada] Document handling of preprocessor directives in GNATppBob Duff1-0/+61
2019-07-08 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Document handling of preprocessor directives in GNATpp. From-SVN: r273203
2019-07-05[Ada] GNAT UGN: refresh doc on installing from the cmd line on WindowsArnaud Charlet1-24/+6
2019-07-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * doc/gnat_ugn/platform_specific_information.rst: Refresh doc on installing from the command line on Windows. Remove obsolete part. * gnat_ugn.texi: Regenerate. From-SVN: r273126
2019-07-05[Ada] Fix typo in GNAT RMBob Duff1-1/+1
2019-07-05 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Fix typo. * gnat_rm.texi: Regenerate. From-SVN: r273104
2019-07-04[Ada] Fix capitalization and parenthesis glitches in GNAT RMEric Botcazou1-4/+3
2019-07-04 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_pragmas.rst: Fix capitalization and parenthesis glitches. * gnat_rm.texi: Regenerate. From-SVN: r273068
2019-07-04[Ada] GNAT.Sockets: fix socket timeout on recent Windows versionsDmitriy Anisimkov1-0/+43
2019-07-04 Dmitriy Anisimkov <anisimko@adacore.com> gcc/ada/ * doc/gnat_ugn/platform_specific_information.rst: Document Windows socket timeout particularity. * gnat_ugn.texi: Regenerate. * gsocket.h: Include versionhelpers.h. * socket.c (__gnat_minus_500ms): New function. * libgnat/g-sothco.ads (Minus_500ms_Windows_Timeout): New imported function. * libgnat/g-socket.adb (Set_Socket_Option): Refactor to remove 500ms from the requested timeout only on old Windows version. From-SVN: r273045
2019-07-03[Ada] Document new flags in GNATppBob Duff1-5/+32
2019-07-03 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Document new flags in GNATpp. From-SVN: r272988
2019-07-03[Ada] Document default new-line behavior for GNATppBob Duff1-0/+2
2019-07-03 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Document default new-line behavior. From-SVN: r272977
2019-07-03[Ada] Style check for mixed-case identifiersBob Duff1-0/+10
This patch implements a new switch, -gnatyD, enables a style check that requires defining identifiers to be in mixed case. 2019-07-03 Bob Duff <duff@adacore.com> gcc/ada/ * par-ch3.adb (P_Defining_Identifier): Call Check_Defining_Identifier_Casing. * style.ads, styleg.ads, styleg.adb (Check_Defining_Identifier_Casing): New procedure to check for mixed-case defining identifiers. * stylesw.ads, stylesw.adb (Style_Check_Mixed_Case_Decls): New flag for checking for mixed-case defining identifiers. * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document new feature. * gnat_ugn.texi: Regenerate. From-SVN: r272972
2019-07-03[Ada] Extend -gnatw.z warning to array typesEric Botcazou1-7/+6
The -gnatw.z switch causes the compiler to issue a warning on record types subject to both an alignment clause and a size clause, when the specified size is not a multiple of the alignment in bits, because this means that the Object_Size will be strictly larger than the specified size. It makes sense to extend this warning to array types, but not to the cases of bit-packed arrays where the size is not a multiple of storage unit and the specified alignment is the minimum one, because there would be no way to get rid of it apart from explicitly silencing it. The compiler must issue the warning: p.ads:5:03: warning: size is not a multiple of alignment for "Triplet" p.ads:5:03: warning: size of 24 specified at line 4 p.ads:5:03: warning: Object_Size will be increased to 32 on the following package: package P is type Triplet is new String (1 .. 3); for Triplet'Size use 24; for Triplet'Alignment use 4; type Arr is array (1 .. 7) of Boolean; pragma Pack (Arr); for Arr'Size use 7; for Arr'Alignment use 1; end P; 2019-07-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Warning message control): Document that -gnatw.z/Z apply to array types. * freeze.adb (Freeze_Entity): Give -gnatw.z warning for array types as well, but not if the specified alignment is the minimum one. * gnat_ugn.texi: Regenerate. From-SVN: r272971
2019-07-03[Ada] Update the section on resolving elaboration circularitiesHristian Kirtchev1-7/+7
2019-07-03 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update the section on resolving elaboration circularities to eliminate certain combinations of switches which together do not produce the desired effect and confuse users. * gnat_ugn.texi: Regenerate. From-SVN: r272966
2019-07-03[Ada] Clarify wording on documentation for No_Multiple_ElaborationArnaud Charlet1-9/+8
2019-07-03 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Clarify wording on No_Multiple_Elaboration. * gnat_rm.texi: Regenerate. From-SVN: r272962
2019-07-03[Ada] Document that boolean types with convention C now map to C99 boolEric Botcazou1-2/+4
2019-07-03 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C): Document that boolean types with convention C now map to C99 bool. * gnat_rm.texi: Regenerate. From-SVN: r272960
2019-07-01[Ada] Correct size in representation clauses documentationPat Rogers1-8/+17
2019-07-01 Pat Rogers <rogers@adacore.com> gcc/ada/ * doc/gnat_rm/representation_clauses_and_pragmas.rst: Correct size indicated for R as a component of an array. * gnat_rm.texi: Regenerate. From-SVN: r272869
2019-07-01[Ada] Fix formatting issues in the gnat_ugn documentationPierre-Marie de Rodat1-2/+2
2019-07-01 Pierre-Marie de Rodat <derodat@adacore.com> gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix formatting issues in the -gnatR section. * gnat_ugn.texi: Regenerate. From-SVN: r272853
2019-05-28implementation_defined_pragmas.rst (Machine_Attribute): Document additional ↵Eric Botcazou1-6/+7
optional parameters. * doc/gnat_rm/implementation_defined_pragmas.rst (Machine_Attribute): Document additional optional parameters. * sem_prag.adb (Analyze_Pragma) <Pragma_Machine_Attribute>: Accept more than one optional parameter. * gcc-interface/decl.c (prepend_one_attribute_pragma): Alphabetize the list of supported pragmas. Simplify the handling of parameters and add support for more than one optional parameter. * gcc-interface/utils.c (attr_cold_hot_exclusions): New constant. (gnat_internal_attribute_table): Add entry for no_icf, noipa, flatten, used, cold, hot, target and target_clones. (begin_subprog_body): Do not create the RTL for the subprogram here. (handle_noicf_attribute): New static function. (handle_noipa_attribute): Likewise. (handle_flatten_attribute): Likewise. (handle_used_attribute): Likewise. (handle_cold_attribute): Likewise. (handle_hot_attribute): Likewise. (handle_target_attribute): Likewise. (handle_target_clones_attribute): Likewise. From-SVN: r271693
2018-12-13Add note about abort and ZCX runtime.Arnaud Charlet1-6/+6
Part of RC12-001 From-SVN: r267079
2018-12-11[Ada] Update gnatmetric documentation for the Libadalang-based versionBob Duff1-181/+211
2018-12-11 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Update gnatmetric documentation for the Libadalang-based version. From-SVN: r266983
2018-12-11[Ada] Update gnatstub documentation for the Libadalang-based versionBob Duff1-147/+146
2018-12-11 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Update gnatstub documentation for the Libadalang-based version. * gnat_ugn.texi: Regenerate. From-SVN: r266981
2018-12-11[Ada] Document the -fgnat-encodings switchPierre-Marie de Rodat1-0/+37
2018-12-11 Pierre-Marie de Rodat <derodat@adacore.com> gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Document the -fgnat-encodings switch. * gnat_ugn.texi: Regenerate. From-SVN: r266979
2018-11-14[Ada] More complete information level for -gnatR outputEric Botcazou1-3/+8
This adds a 4th information level for the -gnatR output, where relevant compiler-generated types are listed in addition to the information already output by -gnatR3. For the following package P: package P is type Arr0 is array (Positive range <>) of Boolean; type Rec (D1 : Positive; D2 : Boolean) is record C1 : Integer; C2 : Arr0 (1 .. D1); case D2 is when False => C3 : Character; when True => C4 : String (1 .. 3); C5 : Float; end case; end record; type Arr1 is array (1 .. 8) of Rec (1, True); end P; the output generated by -gnatR4 must be: Representation information for unit P (spec) -------------------------------------------- for Arr0'Alignment use 1; for Arr0'Component_Size use 8; for Rec'Object_Size use 17179869344; for Rec'Value_Size use (if (#2 != 0) then ((((#1 + 15) & -4) + 8) * 8) else ((((#1 + 15) & -4) + 1) * 8) end); for Rec'Alignment use 4; for Rec use record D1 at 0 range 0 .. 31; D2 at 4 range 0 .. 7; C1 at 8 range 0 .. 31; C2 at 12 range 0 .. ((#1 * 8)) - 1; C3 at ((#1 + 15) & -4) range 0 .. 7; C4 at ((#1 + 15) & -4) range 0 .. 23; C5 at (((#1 + 15) & -4) + 4) range 0 .. 31; end record; for Arr1'Size use 1536; for Arr1'Alignment use 4; for Arr1'Component_Size use 192; for Tarr1c'Size use 192; for Tarr1c'Alignment use 4; for Tarr1c use record D1 at 0 range 0 .. 31; D2 at 4 range 0 .. 7; C1 at 8 range 0 .. 31; C2 at 12 range 0 .. 7; C4 at 16 range 0 .. 23; C5 at 20 range 0 .. 31; end record; 2018-11-14 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (-gnatR): Document new -gnatR4 level. * gnat_ugn.texi: Regenerate. * opt.ads (List_Representation_Info): Bump upper bound to 4. * repinfo.adb: Add with clause for GNAT.HTable. (Relevant_Entities_Size): New constant. (Entity_Header_Num): New type. (Entity_Hash): New function. (Relevant_Entities): New set implemented with GNAT.HTable. (List_Entities): Also list compiled-generated entities present in the Relevant_Entities set. Consider that the Component_Type of an array type is relevant. (List_Rep_Info): Reset Relevant_Entities for each unit. * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatR4. * switch-m.adb (Normalize_Compiler_Switches): Likewise * usage.adb (Usage): Likewise. From-SVN: r266131