[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
This commit is contained in:
Arnaud Charlet 2009-04-22 14:12:36 +02:00
parent 4c33221ccd
commit d9c0e0578a
9 changed files with 352 additions and 335 deletions

View File

@ -1,3 +1,24 @@
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>
* prj-proc.adb, prj-nmsc.adb (Check_Naming_Schemes): split into several

View File

@ -10128,7 +10128,7 @@ required to dereference it each time through the loop.
This kind of optimization, called strict aliasing analysis, is
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.
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
restriction since any possible desired effect can be achieved by
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
@node Coverage Analysis
@subsection Coverage Analysis

File diff suppressed because it is too large Load Diff

View File

@ -2535,11 +2535,14 @@ package body Prj.Proc is
(Imported : in out Project_List;
Limited_With : Boolean)
is
With_Clause : Project_Node_Id := First_With_Clause_Of
(From_Project_Node, From_Project_Node_Tree);
With_Clause : Project_Node_Id;
New_Project : Project_Id;
Proj_Node : Project_Node_Id;
begin
With_Clause :=
First_With_Clause_Of
(From_Project_Node, From_Project_Node_Tree);
while Present (With_Clause) loop
Proj_Node :=
Non_Limited_Project_Node_Of
@ -2585,6 +2588,8 @@ package body Prj.Proc is
end loop;
end Process_Imported_Projects;
-- Start of processing for Recursive_Process
begin
if No (From_Project_Node) then
Project := No_Project;

View File

@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -75,11 +75,8 @@ package body Prj is
(Dot_Replacement => Standard_Dot_Replacement,
Casing => All_Lower_Case,
Spec_Suffix => No_Array_Element,
Ada_Spec_Suffix_Loc => No_Location,
Body_Suffix => No_Array_Element,
Ada_Body_Suffix_Loc => No_Location,
Separate_Suffix => No_File,
Sep_Suffix_Loc => No_Location,
Specs => No_Array_Element,
Bodies => No_Array_Element,
Specification_Exceptions => No_Array_Element,
@ -654,9 +651,10 @@ package body Prj is
Extended : Project_Id;
In_Tree : Project_Tree_Ref) return Boolean
is
Proj : Project_Id := Extending;
Proj : Project_Id;
begin
Proj := Extending;
while Proj /= No_Project loop
if Proj = Extended then
return True;

View File

@ -878,21 +878,14 @@ package Prj is
-- source file name of a spec.
-- Indexed by the programming language.
Ada_Spec_Suffix_Loc : Source_Ptr := No_Location;
Body_Suffix : Array_Element_Id := No_Array_Element;
-- The string to append to the unit name for the
-- source file name of a body.
-- Indexed by the programming language.
Ada_Body_Suffix_Loc : Source_Ptr := No_Location;
Separate_Suffix : File_Name_Type := No_File;
-- 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;
-- An associative array mapping individual specs to source file names
-- This is specific to Ada.

View File

@ -7,7 +7,7 @@
-- S p e c --
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -357,7 +357,7 @@ private
-- section for the resource.
LockSemaphore : Win32.HANDLE;
Reserved : Win32.DWORD;
SpinCount : Win32.DWORD;
end record;
end System.OS_Interface;

View File

@ -527,8 +527,7 @@ package body System.Tasking.Initialization is
while C /= Null_Task loop
if C = T then
if Previous = Null_Task then
All_Tasks_List :=
All_Tasks_List.Common.All_Tasks_Link;
All_Tasks_List := All_Tasks_List.Common.All_Tasks_Link;
else
Previous.Common.All_Tasks_Link := C.Common.All_Tasks_Link;
end if;

View File

@ -515,8 +515,7 @@ package body System.Tasking.Stages is
raise Program_Error with "potentially blocking operation";
end if;
pragma Debug
(Debug.Trace (Self_ID, "Create_Task", 'C'));
pragma Debug (Debug.Trace (Self_ID, "Create_Task", 'C'));
if Priority = Unspecified_Priority then
Base_Priority := Self_ID.Common.Base_Priority;