aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2010-01-26 10:02:11 +0000
committerArnaud Charlet <charlet@adacore.com>2010-01-26 10:02:11 +0000
commit46eb5685bd577a84df2b1ec61454c421bbcd84ab (patch)
tree0381871c3df52168bdd59daf8a8cca434563c28e
parentf1f71a3eb5d54a46f652d066e3492e531bea986a (diff)
2010-01-26 Arnaud Charlet <charlet@adacore.com>
* s-tpoben.adb: Update comments. 2010-01-26 Robert Dewar <dewar@adacore.com> * freeze.adb (Set_Small_Size): Don't set size if alignment clause present. 2010-01-26 Robert Dewar <dewar@adacore.com> * scos.ads: Clean up documentation, remove obsolete XOR references git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@156238 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog12
-rw-r--r--gcc/ada/freeze.adb21
-rw-r--r--gcc/ada/s-tpoben.adb10
-rw-r--r--gcc/ada/scos.ads11
4 files changed, 39 insertions, 15 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3884aa43626..6ed8ae33770 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-26 Arnaud Charlet <charlet@adacore.com>
+
+ * s-tpoben.adb: Update comments.
+
+2010-01-26 Robert Dewar <dewar@adacore.com>
+
+ * freeze.adb (Set_Small_Size): Don't set size if alignment clause
+ present.
+
+2010-01-26 Robert Dewar <dewar@adacore.com>
+
+ * scos.ads: Clean up documentation, remove obsolete XOR references
2010-01-26 Vincent Celier <celier@adacore.com>
* gnat_ugn.texi: Complete documentation on the restrictions for
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 26b821d38d1..c9639361ec0 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -568,7 +568,7 @@ package body Freeze is
procedure Set_Small_Size (T : Entity_Id; S : Uint);
-- Sets the compile time known size (32 bits or less) in the Esize
-- field, of T checking for a size clause that was given which attempts
- -- to give a smaller size.
+ -- to give a smaller size, and also checking for an alignment clause.
function Size_Known (T : Entity_Id) return Boolean;
-- Recursive function that does all the work
@@ -589,6 +589,15 @@ package body Freeze is
if S > 32 then
return;
+ -- Don't bother if alignment clause with a value other than 1 is
+ -- present, because size may be padded up to meet back end alignment
+ -- requirements, and only the back end knows the rules!
+
+ elsif Known_Alignment (T) and then Alignment (T) /= 1 then
+ return;
+
+ -- Check for bad size clause given
+
elsif Has_Size_Clause (T) then
if RM_Size (T) < S then
Error_Msg_Uint_1 := S;
@@ -890,12 +899,12 @@ package body Freeze is
if Is_Elementary_Type (Ctyp)
or else (Is_Array_Type (Ctyp)
- and then Present (Packed_Array_Type (Ctyp))
- and then Is_Modular_Integer_Type
- (Packed_Array_Type (Ctyp)))
+ and then Present (Packed_Array_Type (Ctyp))
+ and then Is_Modular_Integer_Type
+ (Packed_Array_Type (Ctyp)))
then
- -- If RM_Size is known and static, then we can
- -- keep accumulating the packed size.
+ -- If RM_Size is known and static, then we can keep
+ -- accumulating the packed size.
if Known_Static_RM_Size (Ctyp) then
diff --git a/gcc/ada/s-tpoben.adb b/gcc/ada/s-tpoben.adb
index 561d79306c7..4694310ebff 100644
--- a/gcc/ada/s-tpoben.adb
+++ b/gcc/ada/s-tpoben.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2010, 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- --
@@ -226,14 +226,12 @@ package body System.Tasking.Protected_Objects.Entries is
raise Program_Error;
end if;
+ -- pragma Assert (Self_Id.Deferral_Level = 0);
-- If a PO is created from a controlled operation, abort is already
-- deferred at this point, so we need to use Defer_Abort_Nestable
- -- In some cases, the below assertion can be useful to spot
+ -- In some cases, the above assertion can be useful to spot
-- inconsistencies, outside the above scenario involving controlled
- -- types:
-
- -- pragma Assert (Self_Id.Deferral_Level = 0);
- -- Why is this commented out Assert here ???
+ -- types.
Initialization.Defer_Abort_Nestable (Self_ID);
Initialize_Lock (Init_Priority, Object.L'Access);
diff --git a/gcc/ada/scos.ads b/gcc/ada/scos.ads
index a72687426d9..3efc5a54f3d 100644
--- a/gcc/ada/scos.ads
+++ b/gcc/ada/scos.ads
@@ -160,7 +160,12 @@ package SCOs is
-- Decisions
-- Note: in the following description, logical operator includes only the
- -- short circuited forms (so can be only of NOT, AND THEN, or OR ELSE).
+ -- short circuited forms and NOT (so can be only NOT, AND THEN, OR ELSE).
+ -- The reason that we can exclude AND/OR/XOR is that we expect SCO's to
+ -- be generated using the restriction No_Direct_Boolean_Operators, which
+ -- does not permit the use of AND/OR/XOR on boolean operands. These are
+ -- permitted on modular integer types, but such operations do not count
+ -- as decisions in any case
-- Decisions are either simple or complex. A simple decision is a boolean
-- expresssion that occurs in the context of a control structure in the
@@ -217,7 +222,7 @@ package SCOs is
-- expression ::= !sloc term (if expr is NOT)
-- In the last four cases, sloc is the source location of the AND, OR,
- -- XOR or NOT token, respectively.
+ -- or NOT token, respectively.
-- term ::= element
-- term ::= expression
@@ -296,7 +301,7 @@ package SCOs is
-- Operator
-- C1 = '!', '^', '&', '|'
-- C2 = ' '
- -- From = location of NOT/XOR/AND/OR token
+ -- From = location of NOT/AND/OR token
-- To = No_Source_Location
-- Last = False