aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2019-12-16 10:33:50 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-12-16 10:33:50 +0000
commit4a1872632c20e4b93d5d3214505470966c0bebb4 (patch)
tree8cfda6d6a309502ec596cb763dbaa7ca5c589ac6 /gcc/ada
parentd8468b976bb2721c32368e2a80591e77ca49250f (diff)
downloadgcc-4a1872632c20e4b93d5d3214505470966c0bebb4.zip
gcc-4a1872632c20e4b93d5d3214505470966c0bebb4.tar.gz
gcc-4a1872632c20e4b93d5d3214505470966c0bebb4.tar.bz2
[Ada] Bad warning: Size in Compile_Time_Error in nested instance
2019-12-16 Bob Duff <duff@adacore.com> gcc/ada/ * sem_attr.adb (Analyze_Attribute): Use Known_RM_Size. But we still need Size_Known_At_Compile_Time, because when the size really is known, sometimes only one or the other of these is True. From-SVN: r279421
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/sem_attr.adb7
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 95e195d..aa97043 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-16 Bob Duff <duff@adacore.com>
+
+ * sem_attr.adb (Analyze_Attribute): Use Known_RM_Size. But we
+ still need Size_Known_At_Compile_Time, because when the size
+ really is known, sometimes only one or the other of these is
+ True.
+
2019-12-16 Eric Botcazou <ebotcazou@adacore.com>
* sem_util.adb (Is_Atomic_Or_VFA_Object): Also return true for
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index e842293..dcc40d2 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -5841,13 +5841,16 @@ package body Sem_Attr is
-- Time_Errors after the back end has been called and this occurrence
-- of 'Size is known at compile time then it is safe to perform this
-- evaluation. Needed to perform the static evaluation of the full
- -- boolean expression of these pragmas.
+ -- boolean expression of these pragmas. Note that Known_RM_Size is
+ -- sometimes True when Size_Known_At_Compile_Time is False, when the
+ -- back end has computed it.
if In_Compile_Time_Warning_Or_Error
and then Is_Entity_Name (P)
and then (Is_Type (Entity (P))
or else Ekind (Entity (P)) = E_Enumeration_Literal)
- and then Size_Known_At_Compile_Time (Entity (P))
+ and then (Known_RM_Size (Entity (P))
+ or else Size_Known_At_Compile_Time (Entity (P)))
then
declare
Siz : Uint;