diff options
author | Robert Dewar <dewar@adacore.com> | 2008-03-26 08:37:00 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-03-26 08:37:00 +0100 |
commit | 1c3340e65db79867d7aaf37ff4d1876bc01f604c (patch) | |
tree | 5aa501e47f9a126e710cdd4d70396853d6408700 | |
parent | 1e990f1366612be41209fb921d09be00355c117b (diff) | |
download | gcc-1c3340e65db79867d7aaf37ff4d1876bc01f604c.zip gcc-1c3340e65db79867d7aaf37ff4d1876bc01f604c.tar.gz gcc-1c3340e65db79867d7aaf37ff4d1876bc01f604c.tar.bz2 |
checks.adb (Ensure_Valid): Capture valid status if possible (eliminate checks)
2008-03-26 Robert Dewar <dewar@adacore.com>
* checks.adb (Ensure_Valid): Capture valid status if possible
(eliminate checks)
From-SVN: r133553
-rw-r--r-- | gcc/ada/checks.adb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 0af10a6..d815a53 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -619,7 +619,7 @@ package body Checks is if Obj_Size /= No_Uint and then Exp_Size /= No_Uint and then Obj_Size > Exp_Size - and then not Warnings_Off (E) + and then not Has_Warnings_Off (E) then if Address_Clause_Overlay_Warnings then Error_Msg_FE @@ -3890,6 +3890,12 @@ package body Checks is -- If we fall through, a validity check is required Insert_Valid_Check (Expr); + + if Is_Entity_Name (Expr) + and then Safe_To_Capture_Value (Expr, Entity (Expr)) + then + Set_Is_Known_Valid (Entity (Expr)); + end if; end Ensure_Valid; ---------------------- |