diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-10-27 12:50:29 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-10-27 12:50:29 +0100 |
commit | 3f8c04e73cd50d34d2b9f4128c615dbd35a6e40a (patch) | |
tree | 2f1225e96583feab0f21bc963d590f85e1ce0444 /gcc/ada/sem_attr.adb | |
parent | 2bfad6eb411319a475bf7c5f5ffd79fe06780084 (diff) | |
download | gcc-3f8c04e73cd50d34d2b9f4128c615dbd35a6e40a.zip gcc-3f8c04e73cd50d34d2b9f4128c615dbd35a6e40a.tar.gz gcc-3f8c04e73cd50d34d2b9f4128c615dbd35a6e40a.tar.bz2 |
[multiple changes]
2015-10-27 Javier Miranda <miranda@adacore.com>
* sem_util.ads, sem_util.adb (Defining_Identifier): Adding a formal to
indicate the needed behavior in case of nodes with errors.
2015-10-27 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Eval_Attribute): If the prefix of attribute
Enum_Rep is an object that is a generated loop variable for an
element iterator, no folding is possible.
* sem_res.adb (Resolve_Entity_Name): Do not check for a missing
initialization in the case of a constant that is an object
renaming.
* exp_attr.adb (Expand_N_Attribute_Reference, case Enum_Rep):
If the prefix is a constant that renames an expression there is
nothing to evaluate statically.
2015-10-27 Vincent Celier <celier@adacore.com>
* gnatlink.adb: Always delete the response file, even when the
invocation of gcc to link failed.
2015-10-27 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
Do not inherit the SPARK_Mode from the context if it has been
set already.
(Build_Subprogram_Declaration): Relocate relevant
pragmas from the subprogram body to the generated corresponding
spec. Do not copy aspect SPARK_Mode as this leads to circularity
in Copy_Separate_Tree. Inherit the attributes that describe
pragmas Ghost and SPARK_Mode.
(Move_Pragmas): New routine.
From-SVN: r229421
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index c7f1bf5..7112869 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -7286,9 +7286,14 @@ package body Sem_Attr is if Is_Entity_Name (P) then -- The prefix denotes a constant or an enumeration literal, the - -- attribute can be folded. + -- attribute can be folded. A generated loop variable for an + -- iterator is a constant, but cannot be constant-folded. - if Ekind_In (Entity (P), E_Constant, E_Enumeration_Literal) then + if Ekind (Entity (P)) = E_Enumeration_Literal + or else + (Ekind (Entity (P)) = E_Constant + and then Ekind (Scope (Entity (P))) /= E_Loop) + then P_Entity := Etype (P); -- The prefix denotes an enumeration type. Folding can occur |