summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-10 15:14:10 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-10 15:14:10 +0000
commit1b8f51363d06bd4e864fccc6ecf9f9a03e2da6cb (patch)
tree2162f1eefbac597e6278445334a4ca6ae32fa966 /gcc/ada/exp_ch5.adb
parente0c292ff3d0f8f902e5ee82bf4dee22509436091 (diff)
downloadgcc-1b8f51363d06bd4e864fccc6ecf9f9a03e2da6cb.tar.gz
2010-09-10 Bob Duff <duff@adacore.com>
* s-os_lib.ads, g-expect.ads: Add comments. 2010-09-10 Robert Dewar <dewar@adacore.com> * exp_ch5.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164189 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 089987b828c..8760cb7aae2 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -1010,14 +1010,7 @@ package body Exp_Ch5 is
function Build_Step (J : Nat) return Node_Id;
-- The increment step for the index of the right-hand side is written
-- as an attribute reference (Succ or Pred). This function returns
- -- the corresponding node, which is placed at the end of theloop body.
-
- -- Note that on the last iteration of the loop, the index is increased
- -- (or decreased) past the corresponding bound. This is consistent with
- -- the C semantics of the back-end, where such an off-by-one value on a
- -- dead index variable is OK. However, in CodePeer mode this leads to
- -- spurious warnings, and thus we place a guard around the attribute
- -- reference. For obvious reasons we only do this for CodePeer.
+ -- the corresponding node, which is placed at the end of the loop body.
----------------
-- Build_Step --
@@ -1045,6 +1038,13 @@ package body Exp_Ch5 is
Expressions => New_List (
New_Occurrence_Of (Rnn (J), Loc))));
+ -- Note that on the last iteration of the loop, the index is increased
+ -- (or decreased) past the corresponding bound. This is consistent with
+ -- the C semantics of the back-end, where such an off-by-one value on a
+ -- dead index variable is OK. However, in CodePeer mode this leads to
+ -- spurious warnings, and thus we place a guard around the attribute
+ -- reference. For obvious reasons we only do this for CodePeer.
+
if CodePeer_Mode then
Step :=
Make_If_Statement (Loc,