summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_warn.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-10 15:57:48 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-10 15:57:48 +0000
commit19b4517d5e4d093b27bde180434ffa2287c1d120 (patch)
tree58bbafbe6bc51c10f1ee8bb1ad6639c874523ff3 /gcc/ada/sem_warn.adb
parentb6dbc975a60f5009a6ef742d713b11317c98ce84 (diff)
downloadgcc-19b4517d5e4d093b27bde180434ffa2287c1d120.tar.gz
2009-04-10 Robert Dewar <dewar@adacore.com>
* einfo.ads, einfo.adb (Low_Bound_Tested): New name for Low_Bound_Known * sem_prag.adb (Analyze_Pragma, case Check): Remove check for lower bound tested, since this is now done more generally in Sem_Res. * sem_res.adb (Resolve_Comparison_Op): Add call to Check_Lower_Bound_Tested. (Resolve_Equality_Op): Add call to Check_Lower_Bound_Tested * sem_warn.ads, sem_warn.adb (Check_Low_Bound_Tested): New procedure (Low_Bound_Tested): New name for Low_Bound_Known flag * exp_ch5.adb: Minor reformatting * exp_ch4.adb: Add comments on copying the Comes_From_Source flag for allocators * sinfo.ads: Add comments on copying the Comes_From_Source flag for allocators * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Copy Comes_From_Source flag from old allocator to new one. 2009-04-10 Ed Schonberg <schonberg@adacore.com> * sem_ch6.ads: Address missing documentation query 2009-04-10 Vincent Celier <celier@adacore.com> * prj-attr.adb: Add new Linker attributes Max_Command_Line_Length, Response_File_Format and Response_File_Switches. * prj-nmsc.adb (Process_Linker): Process new attributes Max_Command_Line_Length, Response_File_Format and Response_File_Switches. * prj.ads (Response_File_Format): New enumeration type (Project_Configuration): New componants Max_Command_Line_Length, Resp_File_Format and Resp_File_Options. * snames.ads-tmpl: Add new standard names for linking response files for gprbuild: GNU, None, Object_List, Option_List, Max_Command_Line_Length, Response_File_Format and Response_File_Switches. 2009-04-10 Geert Bosch <bosch@adacore.com> * system-aix.ads, system-darwin-ppc.ads, system-darwin-x86.ads, system-freebsd-x86.ads, system-hpux.ads, system-hpux-ia64.ads, system-irix-n32.ads, system-irix-o32.ads, system-linux-alpha.ads, system-linux-hppa.ads, system-linux-ia64.ads, system-linux-ppc.ads, system-linux-s390.ads, system-linux-s390x.ads, system-linux-sh4.ads, system-linux-sparc.ads, system-linux-x86_64.ads, system-linux-x86.ads, system-mingw.ads, system-solaris-sparc.ads, system-solaris-sparcv9.ads, system-solaris-x86.ads, system-tru64.ads, system-vms_64.ads, system-vms.ads, system-vms-ia64.ads, system-vms-zcx.ads, system-vxworks-arm.ads, system-vxworks-m68k.ads, system-vxworks-mips.ads, system-vxworks-ppc.ads, system-vxworks-sparcv9.ads, system-vxworks-x86.ads (Backend_Overflow_Checks): Set to True. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145924 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_warn.adb')
-rw-r--r--gcc/ada/sem_warn.adb25
1 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index d96f697fcbc..7831315ee96 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -604,6 +604,29 @@ package body Sem_Warn is
end if;
end Check_Infinite_Loop_Warning;
+ ----------------------------
+ -- Check_Low_Bound_Tested --
+ ----------------------------
+
+ procedure Check_Low_Bound_Tested (Expr : Node_Id) is
+ begin
+ if Comes_From_Source (Expr) then
+ declare
+ L : constant Node_Id := Left_Opnd (Expr);
+ R : constant Node_Id := Right_Opnd (Expr);
+ begin
+ if Nkind (L) = N_Attribute_Reference
+ and then Attribute_Name (L) = Name_First
+ and then Is_Entity_Name (Prefix (L))
+ and then Is_Formal (Entity (Prefix (L)))
+ and then Nkind (R) = N_Integer_Literal
+ then
+ Set_Low_Bound_Tested (Entity (Prefix (L)));
+ end if;
+ end;
+ end if;
+ end Check_Low_Bound_Tested;
+
----------------------
-- Check_References --
----------------------
@@ -3633,7 +3656,7 @@ package body Sem_Warn is
if Is_Formal (Ent)
and then Is_Suspicious_Type (Typ)
- and then not Low_Bound_Known (Ent)
+ and then not Low_Bound_Tested (Ent)
then
Test_Suspicious_Index;
end if;