aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-04-07 21:02:51 +0200
committerTristan Gingold <tgingold@free.fr>2023-04-07 21:02:51 +0200
commitd8e9367656be7b2c1b5d7d3a6665e7b6a10b719d (patch)
tree843f6a6a9d1e31c656de73161ebbd90b7596385e /src/vhdl
parent776731910064cb6df03be19d788f7f13b2f7d2f1 (diff)
downloadghdl-d8e9367656be7b2c1b5d7d3a6665e7b6a10b719d.tar.gz
ghdl-d8e9367656be7b2c1b5d7d3a6665e7b6a10b719d.tar.bz2
ghdl-d8e9367656be7b2c1b5d7d3a6665e7b6a10b719d.zip
trans-chap7: fix incorrect element layout for concatenation
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/translate/trans-chap7.adb24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/vhdl/translate/trans-chap7.adb b/src/vhdl/translate/trans-chap7.adb
index b7bcf97a8..45d95b8cf 100644
--- a/src/vhdl/translate/trans-chap7.adb
+++ b/src/vhdl/translate/trans-chap7.adb
@@ -1719,13 +1719,25 @@ package body Trans.Chap7 is
Bnd := Chap3.Get_Composite_Bounds (Dyn_Mnodes (1));
if Res_Type = Expr_Type then
Bnd := Chap3.Array_Bounds_To_Element_Layout (Bnd, Expr_Type);
+ Gen_Memcpy
+ (M2Addr (Chap3.Array_Bounds_To_Element_Layout
+ (Var_Bounds, Expr_Type)),
+ M2Addr (Bnd),
+ New_Lit (New_Sizeof (Get_Info (El_Type).B.Layout_Type,
+ Ghdl_Index_Type)));
+ else
+ Gen_Memcpy
+ (M2Addr (Chap3.Array_Bounds_To_Element_Bounds
+ (Var_Bounds, Expr_Type)),
+ M2Addr (Bnd),
+ New_Lit (New_Sizeof (Get_Info (El_Type).B.Bounds_Type,
+ Ghdl_Index_Type)));
+ -- Compute size.
+ Chap3.Gen_Call_Type_Builder
+ (Chap3.Array_Bounds_To_Element_Layout (Var_Bounds, Expr_Type),
+ Get_Element_Subtype (Expr_Type),
+ Mode_Value);
end if;
- Gen_Memcpy
- (M2Addr (Chap3.Array_Bounds_To_Element_Layout
- (Var_Bounds, Expr_Type)),
- M2Addr (Bnd),
- New_Lit (New_Sizeof (Get_Info (El_Type).B.Layout_Type,
- Ghdl_Index_Type)));
end if;
end Eval_One;