aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-02-05 12:22:39 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-02-05 12:22:39 +0100
commitef2c20e73c8989e83863bdb05af0bf629faf5ff2 (patch)
tree8d9d3895dc4cbec40c32fe4e675a705399623c9c /gcc/ada/checks.adb
parentc93f201145542240f9b197b17c06ddab696bbfd4 (diff)
downloadgcc-ef2c20e73c8989e83863bdb05af0bf629faf5ff2.zip
gcc-ef2c20e73c8989e83863bdb05af0bf629faf5ff2.tar.gz
gcc-ef2c20e73c8989e83863bdb05af0bf629faf5ff2.tar.bz2
015-02-05 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb (Add_Invariants): Don't assume invariant is standard Boolean. * sem_prag.adb (Analyze_Pragma, case Check): Don't assume condition is standard Boolean, it can be non-standard derived Boolean. 2015-02-05 Robert Dewar <dewar@adacore.com> * checks.adb (Enable_Range_Check): Disconnect attempted optimization for the case of range check for subscript of unconstrained array. 2015-02-05 Robert Dewar <dewar@adacore.com> * par-ch13.adb (With_Present): New function (Aspect_Specifications_Present): Handle WHEN in place of WITH (Get_Aspect_Specifications): Comment update. * par.adb: Comment updates. 2015-02-05 Robert Dewar <dewar@adacore.com> * errout.adb (Handle_Serious_Error): New setting of Fatal_Error. * frontend.adb (Frontend): New setting of Fatal_Error. * lib-load.adb (Create_Dummy_Package_Unit): New setting of Fatal_Error. (Load_Main_Source): New setting of Fatal_Error (Load_Unit): New setting of Fatal_Error. * lib-writ.adb (Add_Preprocessing_Dependency): New setting of Fatal_Error. (Ensure_System_Dependency): New setting of Fatal_Error. * lib.adb (Fatal_Error): New setting of Fatal_Error (Set_Fatal_Error): New setting of Fatal_Error. * lib.ads: New definition of Fatal_Error and associated routines. * par-ch10.adb (P_Compilation_Unit): New setting of Fatal_Error. * par-load.adb (Load): New setting of Fatal_Error. * rtsfind.adb (Load_RTU): New setting of Fatal_Error. * sem_ch10.adb (Analyze_Compilation_Unit): New setting of Fatal_Error. (Optional_Subunit): New setting of Fatal_Error. (Analyze_Proper_Body): New setting of Fatal_Error. (Load_Needed_Body): New setting of Fatal_Error. 2015-02-05 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Call): If the function being called has out parameters do not check for language version if the function comes from a predefined unit, as those are always compiled in Ada 2012 mode. 2015-02-05 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Process_Full_View): Verify that the full view of a type extension must carry an explicit limited keyword if the partial view does (RM 7.3 (10.1)). From-SVN: r220446
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index e822db3..87c3995 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2015, 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- --
@@ -5521,10 +5521,14 @@ package body Checks is
return;
end if;
- -- Ditto if the prefix is an explicit dereference whose designated
- -- type is unconstrained.
+ -- Ditto if prefix is simply an unconstrained array. We used
+ -- to think this case was OK, if the prefix was not an explicit
+ -- dereference, but we have now seen a case where this is not
+ -- true, so it is safer to just suppress the optimization in this
+ -- case. The back end is getting better at eliminating redundant
+ -- checks in any case, so the loss won't be important.
- elsif Nkind (Prefix (P)) = N_Explicit_Dereference
+ elsif Is_Array_Type (Atyp)
and then not Is_Constrained (Atyp)
then
Activate_Range_Check (N);