diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-06 07:33:43 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-06 07:33:43 +0000 |
commit | ba9b1a3986f32262a221d4cfef7f05338129df82 (patch) | |
tree | 788eee846b0d18dfe72c81fb18eb266c6f5fc50e /gcc/ada/checks.adb | |
parent | f03ce402f3399b269d8f5d564c639f5ae76a14d3 (diff) | |
download | gcc-ba9b1a3986f32262a221d4cfef7f05338129df82.tar.gz |
2012-08-06 Vincent Pucci <pucci@adacore.com>
* exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body):
Use of Known_Static_Esize instead of Known_Esize and
Known_Static_RM_Size instead of Known_RM_Size in order to
properly call UI_To_Int. Don't check the size of the component
type in case of generic.
* sem_ch9.adb (Allows_Lock_Free_Implementation):
Use of Known_Static_Esize instead of Known_Esize and
Known_Static_RM_Size instead of Known_RM_Size in order to properly
call UI_To_Int. Don't check the size of the component type in
case of generic.
2012-08-06 Hristian Kirtchev <kirtchev@adacore.com>
* checks.adb (Discrete_Range_Cond): Do not try to optimize on
the assumption that the type of an expression can always fit in
the target type of a conversion.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190156 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r-- | gcc/ada/checks.adb | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 6ac553382de..58cddfb67cd 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6660,12 +6660,6 @@ package body Checks is LB := New_Occurrence_Of (Discriminal (Entity (LB)), Loc); end if; - if Nkind (HB) = N_Identifier - and then Ekind (Entity (HB)) = E_Discriminant - then - HB := New_Occurrence_Of (Discriminal (Entity (HB)), Loc); - end if; - Left_Opnd := Make_Op_Lt (Loc, Left_Opnd => @@ -6677,28 +6671,10 @@ package body Checks is (Base_Type (Typ), Get_E_First_Or_Last (Loc, Typ, 0, Name_First))); - if Base_Type (Typ) = Typ then - return Left_Opnd; - - elsif Compile_Time_Known_Value (High_Bound (Scalar_Range (Typ))) - and then - Compile_Time_Known_Value (High_Bound (Scalar_Range - (Base_Type (Typ)))) + if Nkind (HB) = N_Identifier + and then Ekind (Entity (HB)) = E_Discriminant then - if Is_Floating_Point_Type (Typ) then - if Expr_Value_R (High_Bound (Scalar_Range (Typ))) = - Expr_Value_R (High_Bound (Scalar_Range (Base_Type (Typ)))) - then - return Left_Opnd; - end if; - - else - if Expr_Value (High_Bound (Scalar_Range (Typ))) = - Expr_Value (High_Bound (Scalar_Range (Base_Type (Typ)))) - then - return Left_Opnd; - end if; - end if; + HB := New_Occurrence_Of (Discriminal (Entity (HB)), Loc); end if; Right_Opnd := |