aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2008-08-20 15:51:37 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2008-08-20 17:51:37 +0200
commit5e5dc75a3ef9ebff03bbf57fc7152e17e2449737 (patch)
treeb7a787da57befa24834db4afd2ab147b56f624ce /gcc
parentdb58b50218a667a806eaf74fb42c8e9afa82afe5 (diff)
downloadgcc-5e5dc75a3ef9ebff03bbf57fc7152e17e2449737.zip
gcc-5e5dc75a3ef9ebff03bbf57fc7152e17e2449737.tar.gz
gcc-5e5dc75a3ef9ebff03bbf57fc7152e17e2449737.tar.bz2
2008-08-20 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb: (Adjust_Record_For_Reverse_Bit_Order): Do not access First_Bit for non-existing component clause. From-SVN: r139323
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog16
-rw-r--r--gcc/ada/sem_ch13.adb89
2 files changed, 62 insertions, 43 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 571e30e..e5057d2 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,19 @@
+2008-08-20 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch13.adb:
+ (Adjust_Record_For_Reverse_Bit_Order): Do not access First_Bit for
+ non-existing component clause.
+
+ * exp_ch5.adb: Minor reformatting
+
+ * g-comlin.adb: Minor reformatting
+
+ * make.adb: Minor reformatting
+
+ * prj-proc.adb: Minor reformatting
+
+ * stylesw.ads: Minor reformatting
+
2008-08-20 Vincent Celier <celier@adacore.com>
* make.adb (Gnatmake_Switch_Found): New Boolean global variable
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index a0154d2..0de30eb 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -222,66 +222,69 @@ package body Sem_Ch13 is
Comp := First_Component_Or_Discriminant (R);
while Present (Comp) loop
declare
- CC : constant Node_Id := Component_Clause (Comp);
- Fbit : constant Uint := Static_Integer (First_Bit (CC));
+ CC : constant Node_Id := Component_Clause (Comp);
begin
if Present (CC) then
+ declare
+ Fbit : constant Uint := Static_Integer (First_Bit (CC));
- -- Case of component with size > max machine scalar
-
- if Esize (Comp) > Max_Machine_Scalar_Size then
+ begin
+ -- Case of component with size > max machine scalar
- -- Must begin on byte boundary
+ if Esize (Comp) > Max_Machine_Scalar_Size then
- if Fbit mod SSU /= 0 then
- Error_Msg_N
- ("illegal first bit value for reverse bit order",
- First_Bit (CC));
- Error_Msg_Uint_1 := SSU;
- Error_Msg_Uint_2 := Max_Machine_Scalar_Size;
+ -- Must begin on byte boundary
- Error_Msg_N
- ("\must be a multiple of ^ if size greater than ^",
- First_Bit (CC));
+ if Fbit mod SSU /= 0 then
+ Error_Msg_N
+ ("illegal first bit value for reverse bit order",
+ First_Bit (CC));
+ Error_Msg_Uint_1 := SSU;
+ Error_Msg_Uint_2 := Max_Machine_Scalar_Size;
- -- Must end on byte boundary
+ Error_Msg_N
+ ("\must be a multiple of ^ if size greater than ^",
+ First_Bit (CC));
- elsif Esize (Comp) mod SSU /= 0 then
- Error_Msg_N
- ("illegal last bit value for reverse bit order",
- Last_Bit (CC));
- Error_Msg_Uint_1 := SSU;
- Error_Msg_Uint_2 := Max_Machine_Scalar_Size;
+ -- Must end on byte boundary
- Error_Msg_N
- ("\must be a multiple of ^ if size greater than ^",
- Last_Bit (CC));
+ elsif Esize (Comp) mod SSU /= 0 then
+ Error_Msg_N
+ ("illegal last bit value for reverse bit order",
+ Last_Bit (CC));
+ Error_Msg_Uint_1 := SSU;
+ Error_Msg_Uint_2 := Max_Machine_Scalar_Size;
- -- OK, give warning if enabled
+ Error_Msg_N
+ ("\must be a multiple of ^ if size greater than ^",
+ Last_Bit (CC));
- elsif Warn_On_Reverse_Bit_Order then
- Error_Msg_N
- ("multi-byte field specified with non-standard"
- & " Bit_Order?", CC);
+ -- OK, give warning if enabled
- if Bytes_Big_Endian then
- Error_Msg_N
- ("\bytes are not reversed "
- & "(component is big-endian)?", CC);
- else
+ elsif Warn_On_Reverse_Bit_Order then
Error_Msg_N
- ("\bytes are not reversed "
- & "(component is little-endian)?", CC);
+ ("multi-byte field specified with non-standard"
+ & " Bit_Order?", CC);
+
+ if Bytes_Big_Endian then
+ Error_Msg_N
+ ("\bytes are not reversed "
+ & "(component is big-endian)?", CC);
+ else
+ Error_Msg_N
+ ("\bytes are not reversed "
+ & "(component is little-endian)?", CC);
+ end if;
end if;
- end if;
- -- Case where size is not greater than max machine scalar.
- -- For now, we just count these.
+ -- Case where size is not greater than max machine
+ -- scalar. For now, we just count these.
- else
- Num_CC := Num_CC + 1;
- end if;
+ else
+ Num_CC := Num_CC + 1;
+ end if;
+ end;
end if;
end;