[PATCH] ada: Simplify redundant test

Samuel Tardieu sam@rfc1149.net
Fri Nov 23 15:08:00 GMT 2007


Compiled and regtested on i686-pc-linux-gnu.

    gcc/ada/
	* sem_ch13.adb (Minimum_Size): Simplify expression as real literals
	are already covered by the Compile_Time_Known_Value check.
---
 gcc/ada/sem_ch13.adb |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index df61a8e..5734e7a 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -3412,9 +3412,7 @@ package body Sem_Ch13 is
             end if;
 
             if not LoSet then
-               if Nkind (Type_Low_Bound (Ancest)) = N_Real_Literal
-                 or else Compile_Time_Known_Value (Type_Low_Bound (Ancest))
-               then
+               if Compile_Time_Known_Value (Type_Low_Bound (Ancest)) then
                   LoR := Expr_Value_R (Type_Low_Bound (Ancest));
                   LoSet := True;
                   exit when HiSet;
@@ -3422,9 +3420,7 @@ package body Sem_Ch13 is
             end if;
 
             if not HiSet then
-               if Nkind (Type_High_Bound (Ancest)) = N_Real_Literal
-                 or else Compile_Time_Known_Value (Type_High_Bound (Ancest))
-               then
+               if Compile_Time_Known_Value (Type_High_Bound (Ancest)) then
                   HiR := Expr_Value_R (Type_High_Bound (Ancest));
                   HiSet := True;
                   exit when LoSet;
-- 
1.5.3.5



More information about the Gcc-patches mailing list