summaryrefslogtreecommitdiff
path: root/rts/include/Stg.h
diff options
context:
space:
mode:
Diffstat (limited to 'rts/include/Stg.h')
-rw-r--r--rts/include/Stg.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/rts/include/Stg.h b/rts/include/Stg.h
index 5849de32c1..31a7a55e9c 100644
--- a/rts/include/Stg.h
+++ b/rts/include/Stg.h
@@ -325,7 +325,11 @@ external prototype return neither of these types to workaround #11395.
Tail calls
-------------------------------------------------------------------------- */
-#define JMP_(cont) return((StgFunPtr)(cont))
+#if defined(HAS_MUSTTAIL)
+#define JMP_(cont) { StgFunPtr (*_f)(void) = (StgFunPtr (*)(void))(cont); __attribute__((musttail)) return _f(); }
+#else
+#define JMP_(cont) return (StgFunPtr)(cont)
+#endif
/* -----------------------------------------------------------------------------
Other Stg stuff...
@@ -591,4 +595,3 @@ typedef union {
c; \
})
#endif
-