diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-26 09:41:03 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-26 09:41:03 +0000 |
commit | baf4e877bfd0ec2899c00f0ca58008c570afccf0 (patch) | |
tree | e61a2ec7f895f9b887d25f053c8e2cfee548edf9 /gcc/ada/exp_ch2.adb | |
parent | e6fe5b69c9783d0c84ef39fc9d00a9e8012ef2a9 (diff) | |
download | gcc-baf4e877bfd0ec2899c00f0ca58008c570afccf0.tar.gz |
2008-05-26 Robert Dewar <dewar@adacore.com>
* exp_ch2.adb:
(Expand_Current_Value): Properly type generated integer literal
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135904 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_ch2.adb')
-rw-r--r-- | gcc/ada/exp_ch2.adb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb index 6093f2a7333..3825405dccf 100644 --- a/gcc/ada/exp_ch2.adb +++ b/gcc/ada/exp_ch2.adb @@ -193,13 +193,21 @@ package body Exp_Ch2 is Unchecked_Convert_To (T, New_Occurrence_Of (Entity (Val), Loc))); - -- Otherwise get the value, and convert to appropriate type + -- If constant is of an integer type, just make an appropriately + -- integer literal, which will get the proper type. + + elsif Is_Integer_Type (T) then + Rewrite (N, + Make_Integer_Literal (Loc, + Intval => Expr_Rep_Value (Val))); + + -- Otherwise do unchecked conversion of value to right type else Rewrite (N, Unchecked_Convert_To (T, - Make_Integer_Literal (Loc, - Intval => Expr_Rep_Value (Val)))); + Make_Integer_Literal (Loc, + Intval => Expr_Rep_Value (Val)))); end if; Analyze_And_Resolve (N, T); |