summaryrefslogtreecommitdiff
path: root/translate
diff options
context:
space:
mode:
authorTristan Gingold2014-01-21 21:48:45 +0100
committerTristan Gingold2014-01-21 21:48:45 +0100
commitee29f133b030abaeadb3e57d0c5db7c3f3e70535 (patch)
treece5373e153edfc6ca1e8922d84218f3f0cb46d2a /translate
parenta5ab19a20dce3e46f73176b3b0534f71f2c44ef3 (diff)
downloadghdl-ee29f133b030abaeadb3e57d0c5db7c3f3e70535.tar.gz
ghdl-ee29f133b030abaeadb3e57d0c5db7c3f3e70535.tar.bz2
ghdl-ee29f133b030abaeadb3e57d0c5db7c3f3e70535.zip
Add pragma Favor_Top_Level for grt.signals.Resolver_Acc.
Diffstat (limited to 'translate')
-rw-r--r--translate/grt/grt-signals.adb15
1 files changed, 14 insertions, 1 deletions
diff --git a/translate/grt/grt-signals.adb b/translate/grt/grt-signals.adb
index 13842d2..fd99e43 100644
--- a/translate/grt/grt-signals.adb
+++ b/translate/grt/grt-signals.adb
@@ -1737,7 +1737,6 @@ package body Grt.Signals is
-- return Length;
-- end Get_Nbr_Non_Null_Source;
-
type Resolver_Acc is access procedure
(Instance : System.Address;
Val : System.Address;
@@ -1746,6 +1745,20 @@ package body Grt.Signals is
Nbr_Drv : Ghdl_Index_Type;
Nbr_Ports : Ghdl_Index_Type);
+ -- On some platforms, GNAT use a descriptor (instead of a trampoline) for
+ -- nested subprograms. This descriptor contains the address of the
+ -- subprogram and the address of the chain. An unaligned pointer to this
+ -- descriptor (address + 1) is then used for 'Access, and every indirect
+ -- call check for unaligned address.
+ --
+ -- Disable this feature (as a resolver is never a nested subprogram), so
+ -- code generated by ghdl is compatible with ghdl runtimes built with
+ -- gnat.
+ --
+ -- If your compiler doesn't understand this pragma, you could safely
+ -- remove the pragma.
+ pragma Favor_Top_Level (Resolver_Acc);
+
function To_Resolver_Acc is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Resolver_Acc);