Commit d9c0e057 by Arnaud Charlet

[multiple changes]

2009-04-22  Robert Dewar  <dewar@adacore.com>

	* prj.adb: Minor code reorganization
	Code clean up.

	* prj-proc.adb: Minor code reorganization, clean up.

	* prj-nmsc.adb: Minor reformatting
	Minor code reorganization

	* gnat_ugn.texi: Add to doc on strict aliasing

2009-04-22  Pascal Obry  <obry@adacore.com>

	* s-osinte-mingw.ads: Rename Reserved field in CRITICAL_SECTION to
	SpinCount.

	* s-tasini.adb: Minor reformatting.

	* s-tassta.adb: Minor reformatting.

From-SVN: r146573
parent 4c33221c
2009-04-22 Robert Dewar <dewar@adacore.com>
* prj.adb: Minor code reorganization
Code clean up.
* prj-proc.adb: Minor code reorganization, clean up.
* prj-nmsc.adb: Minor reformatting
Minor code reorganization
* gnat_ugn.texi: Add to doc on strict aliasing
2009-04-22 Pascal Obry <obry@adacore.com>
* s-osinte-mingw.ads: Rename Reserved field in CRITICAL_SECTION to
SpinCount.
* s-tasini.adb: Minor reformatting.
* s-tassta.adb: Minor reformatting.
2009-04-22 Emmanuel Briot <briot@adacore.com> 2009-04-22 Emmanuel Briot <briot@adacore.com>
* prj-proc.adb, prj-nmsc.adb (Check_Naming_Schemes): split into several * prj-proc.adb, prj-nmsc.adb (Check_Naming_Schemes): split into several
......
...@@ -10128,7 +10128,7 @@ required to dereference it each time through the loop. ...@@ -10128,7 +10128,7 @@ required to dereference it each time through the loop.
This kind of optimization, called strict aliasing analysis, is This kind of optimization, called strict aliasing analysis, is
triggered by specifying an optimization level of @option{-O2} or triggered by specifying an optimization level of @option{-O2} or
higher and allows @code{GNAT} to generate more efficient code higher or @option{-Os} and allows @code{GNAT} to generate more efficient code
when access values are involved. when access values are involved.
However, although this optimization is always correct in terms of However, although this optimization is always correct in terms of
...@@ -10297,6 +10297,21 @@ conversion only for primitive types. This is not really a significant ...@@ -10297,6 +10297,21 @@ conversion only for primitive types. This is not really a significant
restriction since any possible desired effect can be achieved by restriction since any possible desired effect can be achieved by
unchecked conversion of access values. unchecked conversion of access values.
The aliasing analysis done in strict aliasing mode can certainly
have significant benefits. We have seen cases of large scale
application code where the time is increased by up to 5% by turning
this optimization off. If you have code that includes significant
usage of unchecked conversion, you might want to just stick with
@option{-O1} and avoid the entire issue. If you get adequate
performance at this level of optimization level, that's probably
the safest approach. If tests show that you really need higher
levels of optimization, then you can experiment with @option{-O2}
and @option{-O2 -fno-strict-aliasing} to see how much effect this
has on size and speed of the code. If you really need to use
@option{-O2} with strict aliasing in effect, then you should
review any uses of unchecked conversion of access types,
particularly if you are getting the warnings described above.
@ifset vms @ifset vms
@node Coverage Analysis @node Coverage Analysis
@subsection Coverage Analysis @subsection Coverage Analysis
...@@ -2535,11 +2535,14 @@ package body Prj.Proc is ...@@ -2535,11 +2535,14 @@ package body Prj.Proc is
(Imported : in out Project_List; (Imported : in out Project_List;
Limited_With : Boolean) Limited_With : Boolean)
is is
With_Clause : Project_Node_Id := First_With_Clause_Of With_Clause : Project_Node_Id;
(From_Project_Node, From_Project_Node_Tree);
New_Project : Project_Id; New_Project : Project_Id;
Proj_Node : Project_Node_Id; Proj_Node : Project_Node_Id;
begin begin
With_Clause :=
First_With_Clause_Of
(From_Project_Node, From_Project_Node_Tree);
while Present (With_Clause) loop while Present (With_Clause) loop
Proj_Node := Proj_Node :=
Non_Limited_Project_Node_Of Non_Limited_Project_Node_Of
...@@ -2585,6 +2588,8 @@ package body Prj.Proc is ...@@ -2585,6 +2588,8 @@ package body Prj.Proc is
end loop; end loop;
end Process_Imported_Projects; end Process_Imported_Projects;
-- Start of processing for Recursive_Process
begin begin
if No (From_Project_Node) then if No (From_Project_Node) then
Project := No_Project; Project := No_Project;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2008, Free Software Foundation, Inc. -- -- Copyright (C) 2001-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -75,11 +75,8 @@ package body Prj is ...@@ -75,11 +75,8 @@ package body Prj is
(Dot_Replacement => Standard_Dot_Replacement, (Dot_Replacement => Standard_Dot_Replacement,
Casing => All_Lower_Case, Casing => All_Lower_Case,
Spec_Suffix => No_Array_Element, Spec_Suffix => No_Array_Element,
Ada_Spec_Suffix_Loc => No_Location,
Body_Suffix => No_Array_Element, Body_Suffix => No_Array_Element,
Ada_Body_Suffix_Loc => No_Location,
Separate_Suffix => No_File, Separate_Suffix => No_File,
Sep_Suffix_Loc => No_Location,
Specs => No_Array_Element, Specs => No_Array_Element,
Bodies => No_Array_Element, Bodies => No_Array_Element,
Specification_Exceptions => No_Array_Element, Specification_Exceptions => No_Array_Element,
...@@ -654,9 +651,10 @@ package body Prj is ...@@ -654,9 +651,10 @@ package body Prj is
Extended : Project_Id; Extended : Project_Id;
In_Tree : Project_Tree_Ref) return Boolean In_Tree : Project_Tree_Ref) return Boolean
is is
Proj : Project_Id := Extending; Proj : Project_Id;
begin begin
Proj := Extending;
while Proj /= No_Project loop while Proj /= No_Project loop
if Proj = Extended then if Proj = Extended then
return True; return True;
......
...@@ -878,21 +878,14 @@ package Prj is ...@@ -878,21 +878,14 @@ package Prj is
-- source file name of a spec. -- source file name of a spec.
-- Indexed by the programming language. -- Indexed by the programming language.
Ada_Spec_Suffix_Loc : Source_Ptr := No_Location;
Body_Suffix : Array_Element_Id := No_Array_Element; Body_Suffix : Array_Element_Id := No_Array_Element;
-- The string to append to the unit name for the -- The string to append to the unit name for the
-- source file name of a body. -- source file name of a body.
-- Indexed by the programming language. -- Indexed by the programming language.
Ada_Body_Suffix_Loc : Source_Ptr := No_Location;
Separate_Suffix : File_Name_Type := No_File; Separate_Suffix : File_Name_Type := No_File;
-- String to append to unit name for source file name of an Ada subunit -- String to append to unit name for source file name of an Ada subunit
Sep_Suffix_Loc : Source_Ptr := No_Location;
-- Position in the project file source where Separate_Suffix is defined
Specs : Array_Element_Id := No_Array_Element; Specs : Array_Element_Id := No_Array_Element;
-- An associative array mapping individual specs to source file names -- An associative array mapping individual specs to source file names
-- This is specific to Ada. -- This is specific to Ada.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1991-1994, Florida State University -- -- Copyright (C) 1991-1994, Florida State University --
-- Copyright (C) 1995-2008, Free Software Foundation, Inc. -- -- Copyright (C) 1995-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNARL is free software; you can redistribute it and/or modify it under -- -- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -357,7 +357,7 @@ private ...@@ -357,7 +357,7 @@ private
-- section for the resource. -- section for the resource.
LockSemaphore : Win32.HANDLE; LockSemaphore : Win32.HANDLE;
Reserved : Win32.DWORD; SpinCount : Win32.DWORD;
end record; end record;
end System.OS_Interface; end System.OS_Interface;
...@@ -527,8 +527,7 @@ package body System.Tasking.Initialization is ...@@ -527,8 +527,7 @@ package body System.Tasking.Initialization is
while C /= Null_Task loop while C /= Null_Task loop
if C = T then if C = T then
if Previous = Null_Task then if Previous = Null_Task then
All_Tasks_List := All_Tasks_List := All_Tasks_List.Common.All_Tasks_Link;
All_Tasks_List.Common.All_Tasks_Link;
else else
Previous.Common.All_Tasks_Link := C.Common.All_Tasks_Link; Previous.Common.All_Tasks_Link := C.Common.All_Tasks_Link;
end if; end if;
......
...@@ -515,8 +515,7 @@ package body System.Tasking.Stages is ...@@ -515,8 +515,7 @@ package body System.Tasking.Stages is
raise Program_Error with "potentially blocking operation"; raise Program_Error with "potentially blocking operation";
end if; end if;
pragma Debug pragma Debug (Debug.Trace (Self_ID, "Create_Task", 'C'));
(Debug.Trace (Self_ID, "Create_Task", 'C'));
if Priority = Unspecified_Priority then if Priority = Unspecified_Priority then
Base_Priority := Self_ID.Common.Base_Priority; Base_Priority := Self_ID.Common.Base_Priority;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment