summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_eval.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-05 10:38:36 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-05 10:38:36 +0000
commit3a12891883fab1c184e9b715b1548c58c52d1c99 (patch)
tree2de998890738052a18d601918218650475cb0b05 /gcc/ada/sem_eval.adb
parent60cd3d0e80844555587475098876db88b16109b0 (diff)
downloadlinaro-gcc-3a12891883fab1c184e9b715b1548c58c52d1c99.tar.gz
linaro-gcc-3a12891883fab1c184e9b715b1548c58c52d1c99.tar.bz2
linaro-gcc-3a12891883fab1c184e9b715b1548c58c52d1c99.zip
2012-12-05 Ed Schonberg <schonberg@adacore.com>
* sem_eval.adb: Remove spurious warnings. 2012-12-05 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Build_Explicit_Dereference): Set properly the type of the prefix prior to rewriting, because subsequent legality checks examine the original node. 2012-12-05 Hristian Kirtchev <kirtchev@adacore.com> * aspects.adb: Add Contract_Cases to the canonical aspects map. * aspects.ads: Add aspect Contract_Cases in the various aspect tables. * par-prag.adb: The parser does not need to perform special actions for pragma Contract_Cases. * sem_ch6.adb (Expand_Contract_Cases): New routine. (Process_Contract_Cases): Convert pragma Contract_Cases into pre- and post- condition checks that verify the runtime state of all case guards and their corresponding consequences. * sem_ch13.adb (Analyze_Aspect_Specifications): Perform various legality checks on aspect Contract_Cases. The aspect is transformed into a pragma. * sem_prag.adb: Add an entry in table Sig_Flags for pragma Contract_Cases. (Analyze_Pragma): Perform various legality checks on pragma Contract_Cases. The pragma is associated with the contract of the related subprogram. (Chain_CTC): Omit pragma Contract_Cases because it does not introduce a unique case name and does not follow the syntax of Contract_Case and Test_Case. * snames.ads-tmpl: Add new name Name_Contract_Cases. Add a Pragma_Id for Contract_Cases. 2012-12-05 Thomas Quinot <quinot@adacore.com> * sem_ch5.adb: Minor reformatting. 2012-12-05 Hristian Kirtchev <kirtchev@adacore.com> * sem_attr.ads: Add an entry for attribute Loop_Entry in the Attribute_Impl_Def table. 2012-12-05 Bob Duff <duff@adacore.com> * gnatchop.adb (Read_File): Avoid storage leak, and in most cases avoid an extra copy of the string. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_eval.adb')
-rw-r--r--gcc/ada/sem_eval.adb13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index cf2a922f120..4a8fa2c627f 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -1314,11 +1314,22 @@ package body Sem_Eval is
-- is at optimizing and knowing that things are constant when they are
-- nonstatic.
+ -- We make an exception for expressions that evaluate to True/False, to
+ -- suppress spurious checks in ZFP mode.
+
if Configurable_Run_Time_Mode
and then K /= N_Null
and then not Is_Static_Expression (Op)
then
- return False;
+ if Is_Entity_Name (Op)
+ and then Ekind (Entity (Op)) = E_Enumeration_Literal
+ and then Etype (Entity (Op)) = Standard_Boolean
+ then
+ null;
+
+ else
+ return False;
+ end if;
end if;
-- If we have an entity name, then see if it is the name of a constant