aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-05-22 21:15:40 +0200
committerTristan Gingold <tgingold@free.fr>2015-05-22 21:15:40 +0200
commit6d809ee2e64d5033b62db219f86707e30babe381 (patch)
tree14aa131265a68e9ea6a6f15243c04ae094bdd4e7 /src
parenta2430c1aa08cfe58e7173c8950e2b5df32a91859 (diff)
downloadghdl-6d809ee2e64d5033b62db219f86707e30babe381.tar.gz
ghdl-6d809ee2e64d5033b62db219f86707e30babe381.tar.bz2
ghdl-6d809ee2e64d5033b62db219f86707e30babe381.zip
Restore relaxed semantic for array attribute staticness.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/sem_names.adb15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index 897abef5e..66bd04838 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -885,6 +885,7 @@ package body Sem_Names is
Index_Type : Iir;
Prefix : Iir;
Prefix_Name : Iir;
+ Staticness : Iir_Staticness;
begin
-- LRM93 14.1
-- Parameter: A locally static expression of type universal_integer, the
@@ -985,7 +986,19 @@ package body Sem_Names is
-- A globally static array subtype is a constrained array subtype
-- formed by imposing on an unconstrained array type a globally static
-- index constraint.
- Set_Expr_Staticness (Attr, Get_Type_Staticness (Prefix_Type));
+
+ Staticness := Get_Type_Staticness (Prefix_Type);
+
+ -- In relaxed mode, also consider that globally static expressions have
+ -- a globally static subtype.
+ if Is_Type_Name (Prefix_Name) = Null_Iir
+ and then Staticness = None
+ and then (Flag_Relaxed_Rules or Vhdl_Std = Vhdl_93c)
+ then
+ Staticness := Iir_Staticness'Max (Globally,
+ Get_Expr_Staticness (Prefix));
+ end if;
+ Set_Expr_Staticness (Attr, Staticness);
end Finish_Sem_Array_Attribute;
procedure Finish_Sem_Scalar_Type_Attribute