From 8520993b4d1eadefa488dfc96dff25333f1b19db Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 4 Sep 2015 21:52:38 +0200 Subject: Suppress stack switching; save process state in secondary stack. --- src/vhdl/translate/trans-chap3.adb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/vhdl/translate/trans-chap3.adb') diff --git a/src/vhdl/translate/trans-chap3.adb b/src/vhdl/translate/trans-chap3.adb index 6ab2802..fd946d1 100644 --- a/src/vhdl/translate/trans-chap3.adb +++ b/src/vhdl/translate/trans-chap3.adb @@ -2641,6 +2641,20 @@ package body Trans.Chap3 is end if; end Get_Object_Size; + procedure Copy_Bounds (Dest : O_Enode; Src : O_Enode; Obj_Type : Iir) + is + Tinfo : constant Type_Info_Acc := Get_Info (Obj_Type); + begin + Gen_Memcpy + (Dest, Src, + New_Lit (New_Sizeof (Tinfo.T.Bounds_Type, Ghdl_Index_Type))); + end Copy_Bounds; + + procedure Copy_Bounds (Dest : Mnode; Src : Mnode; Obj_Type : Iir) is + begin + Copy_Bounds (M2Addr (Dest), M2Addr (Src), Obj_Type); + end Copy_Bounds; + procedure Translate_Object_Allocation (Res : in out Mnode; Alloc_Kind : Allocation_Kind; @@ -2660,10 +2674,7 @@ package body Trans.Chap3 is Dinfo.T.Bounds_Ptr_Type)); -- Copy bounds to the allocated area. - Gen_Memcpy - (M2Addr (Chap3.Get_Array_Bounds (Res)), - M2Addr (Bounds), - New_Lit (New_Sizeof (Dinfo.T.Bounds_Type, Ghdl_Index_Type))); + Copy_Bounds (Chap3.Get_Array_Bounds (Res), Bounds, Obj_Type); -- Allocate base. Allocate_Fat_Array_Base (Alloc_Kind, Res, Obj_Type); -- cgit