]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Attribute Address is not an interfering context in SPARK
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 29 Jan 2021 11:16:17 +0000 (12:16 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 7 May 2021 09:29:04 +0000 (05:29 -0400)
gcc/ada/

* sem_res.adb (Flag_Object): Ignore prefixes of attribute
Address.

gcc/ada/sem_res.adb

index bd950f5df861ea795021dc8fcf5f28111cab4bdf..898f317f8f462c7142f2d79b659792a84dd386ce 100644 (file)
@@ -3749,6 +3749,19 @@ package body Sem_Res is
 
          begin
             case Nkind (N) is
+
+               --  Do not consider object name appearing in the prefix of
+               --  attribute Address as a read.
+
+               when N_Attribute_Reference =>
+
+                  --  Prefix of attribute Address denotes an object, program
+                  --  unit, or label; none of them needs to be flagged here.
+
+                  if Attribute_Name (N) = Name_Address then
+                     return Skip;
+                  end if;
+
                --  Do not consider nested function calls because they have
                --  already been processed during their own resolution.