summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-07 16:56:30 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-07 16:56:30 +0000
commit449a120bd17a77cf35e15443328424bfbbb28197 (patch)
treebf873f637952d8d54457128fc745e447b244ee92 /gcc/ada/exp_ch4.adb
parentaab739719174e0c4271176931dca76c1edf5ce0d (diff)
downloadgcc-449a120bd17a77cf35e15443328424bfbbb28197.tar.gz
2009-04-07 Thomas Quinot <quinot@adacore.com>
* exp_ch4.adb (Expand_Concatenate): Add missing conversion to index type for the case of concatenating a constrained array indexed by an enumeration type. 2009-04-07 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Check_Conformance): when checking conformance of an operation that overrides an abstract operation inherited from an interface, return False if only one of the controlling formals is an access parameter. 2009-04-07 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Analyze_Object_Renaming): additional error messages mandated by AI05-105. 2009-04-07 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Get_Mains): Warn if a main is an empty string 2009-04-07 Thomas Quinot <quinot@adacore.com> * usage.adb: Minor fix in usage message. * sem_ch10.adb (Remove_Homonyms): Fix subtype of formal in body to match declaration; the correct subtype is Node_Id, not Entity_Id, because the expected node kind is an identifier, not a defining identifier. * switch-c.adb: Minor reformatting. * uintp.adb: Minor reformatting. 2009-04-07 Robert Dewar <dewar@adacore.com> * exp_ch13.adb: Minor reformatting git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb25
1 files changed, 7 insertions, 18 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index df1d2bb26a9..771efd49dd2 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -2383,24 +2383,15 @@ package body Exp_Ch4 is
Fixed_Length (NN) := Uint_1;
Result_May_Be_Null := False;
- -- Set bounds of operand
+ -- Set bounds of operand (no need to set high bound since we know
+ -- for sure that result won't be null, so we won't ever use
+ -- Opnd_High_Bound).
Opnd_Low_Bound (NN) :=
Make_Attribute_Reference (Loc,
Prefix => New_Reference_To (Ityp, Loc),
Attribute_Name => Name_First);
- -- ??? The addition below is dubious, what if Ityp is an enum
- -- type, shouldn't this be Ityp'Succ (Ityp'First)?
-
- Opnd_High_Bound (NN) :=
- Make_Op_Add (Loc,
- Left_Opnd =>
- Make_Attribute_Reference (Loc,
- Prefix => New_Reference_To (Ityp, Loc),
- Attribute_Name => Name_First),
- Right_Opnd => Make_Integer_Literal (Loc, 1));
-
Set := True;
-- String literal case (can only occur for strings of course)
@@ -2477,15 +2468,13 @@ package body Exp_Ch4 is
Is_Fixed_Length (NN) := True;
Fixed_Length (NN) := Len;
- -- ??? case where Ityp is an enum type?
-
- Opnd_Low_Bound (NN) :=
+ Opnd_Low_Bound (NN) := To_Ityp (
Make_Integer_Literal (Loc,
- Intval => Expr_Value (Lo));
+ Intval => Expr_Value (Lo)));
- Opnd_High_Bound (NN) :=
+ Opnd_High_Bound (NN) := To_Ityp (
Make_Integer_Literal (Loc,
- Intval => Expr_Value (Hi));
+ Intval => Expr_Value (Hi)));
Set := True;
end;