summaryrefslogtreecommitdiff
path: root/gcc/ada/targparm.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-09 10:44:13 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-09 10:44:13 +0000
commit913ab0bcf89d43928f8fee35b22602d841d39c3a (patch)
treea7fdab111d66cef67c5aaf972703425f9ebca4e9 /gcc/ada/targparm.adb
parenta31db762c8cfc6b34a818b70b7166a74aef46d0d (diff)
downloadgcc-913ab0bcf89d43928f8fee35b22602d841d39c3a.tar.gz
2004-02-09 Albert Lee <lee@gnat.com>
* errno.c: define _SGI_MP_SOURCE for task-safe errno on IRIX 2004-02-09 Ed Schonberg <schonberg@gnat.com> * exp_ch3.adb (Build_Slice_Assignment): Handle properly case of null slices. * exp_ch6.adb (Expand_Call): Do not inline a call when the subprogram is nested in an instance that is not frozen yet, to avoid order-of-elaboration problems in gigi. * sem_attr.adb (Analyze_Attribute, case 'Access): Within an inlined body the attribute is legal. 2004-02-09 Robert Dewar <dewar@gnat.com> * s-rident.ads: Minor comment correction * targparm.adb: Remove dependence on uintp completely. There was always a bug in Make in that it called Targparm before initializing the Uint package. The old code appeared to get away with this, but the new code did not! This caused an assertion error in gnatmake. * targparm.ads: Fix bad comment, restriction pragmas with parameters are indeed fully supported. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77531 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/targparm.adb')
-rw-r--r--gcc/ada/targparm.adb42
1 files changed, 29 insertions, 13 deletions
diff --git a/gcc/ada/targparm.adb b/gcc/ada/targparm.adb
index 65842b425db..4896da37f7e 100644
--- a/gcc/ada/targparm.adb
+++ b/gcc/ada/targparm.adb
@@ -29,7 +29,6 @@ with Namet; use Namet;
with Opt; use Opt;
with Osint; use Osint;
with Output; use Output;
-with Uintp; use Uintp;
package body Targparm is
use ASCII;
@@ -193,7 +192,7 @@ package body Targparm is
Source_Last : Source_Ptr)
is
P : Source_Ptr;
- V : Uint;
+ -- Scans source buffer containing source of system.ads
Fatal : Boolean := False;
-- Set True if a fatal error is detected
@@ -221,7 +220,7 @@ package body Targparm is
elsif System_Text (P .. P + 20) = "pragma Restrictions (" then
P := P + 21;
- Rloop : for K in Partition_Boolean_Restrictions loop
+ Rloop : for K in All_Boolean_Restrictions loop
declare
Rname : constant String := Restriction_Id'Image (K);
@@ -249,6 +248,9 @@ package body Targparm is
Rname : constant String :=
All_Parameter_Restrictions'Image (K);
+ V : Natural;
+ -- Accumulates value
+
begin
for J in Rname'Range loop
if Fold_Upper (System_Text (P + Source_Ptr (J - 1)))
@@ -262,22 +264,36 @@ package body Targparm is
" => "
then
P := P + Rname'Length + 4;
- V := Uint_0;
+ V := 0;
loop
if System_Text (P) in '0' .. '9' then
- V := 10 * V + Character'Pos (System_Text (P)) - 48;
+ declare
+ pragma Unsuppress (Overflow_Check);
+
+ begin
+ -- Accumulate next digit
+
+ V := 10 * V +
+ Character'Pos (System_Text (P)) -
+ Character'Pos ('0');
+
+ exception
+ -- On overflow, we just ignore the pragma since
+ -- that is the standard handling in this case.
+
+ when Constraint_Error =>
+ goto Line_Loop_Continue;
+ end;
+
elsif System_Text (P) = '_' then
null;
+
elsif System_Text (P) = ')' then
- if UI_Is_In_Int_Range (V) then
- Restrictions_On_Target.Value (K) :=
- Integer (UI_To_Int (V));
- Restrictions_On_Target.Set (K) := True;
- goto Line_Loop_Continue;
- else
- exit Ploop;
- end if;
+ Restrictions_On_Target.Value (K) := V;
+ Restrictions_On_Target.Set (K) := True;
+ goto Line_Loop_Continue;
+
else
exit Ploop;
end if;