From d8e9367656be7b2c1b5d7d3a6665e7b6a10b719d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 7 Apr 2023 21:02:51 +0200 Subject: trans-chap7: fix incorrect element layout for concatenation --- src/vhdl/translate/trans-chap7.adb | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src') 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; -- cgit v1.2.3