summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-06 10:01:05 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-06 10:01:05 +0000
commit9a4463ea5a30547f306f9df07da2885d6c606161 (patch)
tree6f7793841c4e1fcde4c33c02fe46029e82f1af2e
parentfed75ba593e302369f6a01c35be1186a9731c323 (diff)
downloadgcc-9a4463ea5a30547f306f9df07da2885d6c606161.tar.gz
2015-01-06 Robert Dewar <dewar@adacore.com>
* snames.ads-tmpl: Remove entries for attribute Enum_Image. * exp_attr.adb: Remove reference to Attribute_Enum_Image. 2015-01-06 Robert Dewar <dewar@adacore.com> * s-vallli.adb (Value_Long_Long_Integer): Handle case of Str'Last = Positive'Last. * s-valllu.adb (Value_Long_Long_Unsigned): Handle case of Str'Last = Positive'Last. 2015-01-06 Robert Dewar <dewar@adacore.com> * sem_prag.adb (Process_Inline): Remove redundant construct warning (-gnatw.r) for an ineffective pragma Inline. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219244 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/exp_attr.adb1
-rw-r--r--gcc/ada/s-vallli.adb28
-rw-r--r--gcc/ada/s-valllu.adb28
-rw-r--r--gcc/ada/sem_prag.adb20
-rw-r--r--gcc/ada/snames.ads-tmpl2
6 files changed, 63 insertions, 33 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7b2ec9d551c..7eeb8cce9ff 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,22 @@
2015-01-06 Robert Dewar <dewar@adacore.com>
+ * snames.ads-tmpl: Remove entries for attribute Enum_Image.
+ * exp_attr.adb: Remove reference to Attribute_Enum_Image.
+
+2015-01-06 Robert Dewar <dewar@adacore.com>
+
+ * s-vallli.adb (Value_Long_Long_Integer): Handle case of Str'Last
+ = Positive'Last.
+ * s-valllu.adb (Value_Long_Long_Unsigned): Handle case of
+ Str'Last = Positive'Last.
+
+2015-01-06 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb (Process_Inline): Remove redundant construct
+ warning (-gnatw.r) for an ineffective pragma Inline.
+
+2015-01-06 Robert Dewar <dewar@adacore.com>
+
* s-valint.adb: Fix typo in last checkin.
* s-valuns.adb (Value_Unsigned): More efficient fix for
Positive'Last case.
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index 5a66e3f55a2..74b013ee687 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -7178,7 +7178,6 @@ package body Exp_Attr is
Attribute_Digits |
Attribute_Emax |
Attribute_Enabled |
- Attribute_Enum_Image |
Attribute_Epsilon |
Attribute_Fast_Math |
Attribute_First_Valid |
diff --git a/gcc/ada/s-vallli.adb b/gcc/ada/s-vallli.adb
index 203e475b3cf..bf0e15d1234 100644
--- a/gcc/ada/s-vallli.adb
+++ b/gcc/ada/s-vallli.adb
@@ -91,12 +91,30 @@ package body System.Val_LLI is
-----------------------------
function Value_Long_Long_Integer (Str : String) return Long_Long_Integer is
- V : Long_Long_Integer;
- P : aliased Integer := Str'First;
begin
- V := Scan_Long_Long_Integer (Str, P'Access, Str'Last);
- Scan_Trailing_Blanks (Str, P);
- return V;
+ -- We have to special case Str'Last = Positive'Last because the normal
+ -- circuit ends up setting P to Str'Last + 1 which is out of bounds. We
+ -- deal with this by converting to a subtype which fixes the bounds.
+
+ if Str'Last = Positive'Last then
+ declare
+ subtype NT is String (1 .. Str'Length);
+ begin
+ return Value_Long_Long_Integer (NT (Str));
+ end;
+
+ -- Normal case where Str'Last < Positive'Last
+
+ else
+ declare
+ V : Long_Long_Integer;
+ P : aliased Integer := Str'First;
+ begin
+ V := Scan_Long_Long_Integer (Str, P'Access, Str'Last);
+ Scan_Trailing_Blanks (Str, P);
+ return V;
+ end;
+ end if;
end Value_Long_Long_Integer;
end System.Val_LLI;
diff --git a/gcc/ada/s-valllu.adb b/gcc/ada/s-valllu.adb
index 3315b1d7c7f..90ce099c623 100644
--- a/gcc/ada/s-valllu.adb
+++ b/gcc/ada/s-valllu.adb
@@ -294,12 +294,30 @@ package body System.Val_LLU is
function Value_Long_Long_Unsigned
(Str : String) return Long_Long_Unsigned
is
- V : Long_Long_Unsigned;
- P : aliased Integer := Str'First;
begin
- V := Scan_Long_Long_Unsigned (Str, P'Access, Str'Last);
- Scan_Trailing_Blanks (Str, P);
- return V;
+ -- We have to special case Str'Last = Positive'Last because the normal
+ -- circuit ends up setting P to Str'Last + 1 which is out of bounds. We
+ -- deal with this by converting to a subtype which fixes the bounds.
+
+ if Str'Last = Positive'Last then
+ declare
+ subtype NT is String (1 .. Str'Length);
+ begin
+ return Value_Long_Long_Unsigned (NT (Str));
+ end;
+
+ -- Normal case where Str'Last < Positive'Last
+
+ else
+ declare
+ V : Long_Long_Unsigned;
+ P : aliased Integer := Str'First;
+ begin
+ V := Scan_Long_Long_Unsigned (Str, P'Access, Str'Last);
+ Scan_Trailing_Blanks (Str, P);
+ return V;
+ end;
+ end if;
end Value_Long_Long_Unsigned;
end System.Val_LLU;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 2c4d531f9e0..3ced30d6feb 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -8087,10 +8087,6 @@ package body Sem_Prag is
Subp : Entity_Id;
Applies : Boolean;
- Effective : Boolean := False;
- -- Set True if inline has some effect, i.e. if there is at least one
- -- subprogram set as inlined as a result of the use of the pragma.
-
procedure Make_Inline (Subp : Entity_Id);
-- Subp is the defining unit name of the subprogram declaration. Set
-- the flag, as well as the flag in the corresponding body, if there
@@ -8348,7 +8344,6 @@ package body Sem_Prag is
if not Has_Pragma_Inline (Subp) then
Set_Has_Pragma_Inline (Subp);
- Effective := True;
end if;
end if;
@@ -8392,7 +8387,6 @@ package body Sem_Prag is
Check_Error_Detected;
Applies := True;
- Effective := True;
else
Make_Inline (Subp);
@@ -8416,20 +8410,6 @@ package body Sem_Prag is
if not Applies then
Error_Pragma_Arg
("inappropriate argument for pragma%", Assoc);
-
- elsif not Effective
- and then Warn_On_Redundant_Constructs
- and then not (Status = Suppressed or else Suppress_All_Inlining)
- then
- if Inlining_Not_Possible (Subp) then
- Error_Msg_NE
- ("pragma Inline for& is ignored?r?",
- N, Entity (Subp_Id));
- else
- Error_Msg_NE
- ("pragma Inline for& is redundant?r?",
- N, Entity (Subp_Id));
- end if;
end if;
Next (Assoc);
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index 73b1e366d7e..673a7530cd2 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -962,7 +962,6 @@ package Snames is
Name_Adjacent : constant Name_Id := N + $;
Name_Ceiling : constant Name_Id := N + $;
Name_Copy_Sign : constant Name_Id := N + $;
- Name_Enum_Image : constant Name_Id := N + $;
Name_Floor : constant Name_Id := N + $;
Name_Fraction : constant Name_Id := N + $;
Name_From_Any : constant Name_Id := N + $; -- GNAT
@@ -1590,7 +1589,6 @@ package Snames is
Attribute_Adjacent,
Attribute_Ceiling,
Attribute_Copy_Sign,
- Attribute_Enum_Image,
Attribute_Floor,
Attribute_Fraction,
Attribute_From_Any,