summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Trangez <ikke@nicolast.be>2022-10-30 20:34:57 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-02 12:06:48 -0400
commit81a5843333c9121b055b13907794a8afe24cd747 (patch)
tree82f9e7368cc4845fd3f999fab9b0022a88727489
parentf963865452187eb7637fddcdfcd2f506ff1f34cf (diff)
downloadhaskell-81a5843333c9121b055b13907794a8afe24cd747.tar.gz
rts: introduce (and use) `STG_USED`
Similar to `STG_UNUSED`, have a specific macro for `__attribute__(used)`.
-rw-r--r--rts/StgCRun.c8
-rw-r--r--rts/include/Stg.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/rts/StgCRun.c b/rts/StgCRun.c
index 4fefc326e5..819dae3f4b 100644
--- a/rts/StgCRun.c
+++ b/rts/StgCRun.c
@@ -163,7 +163,7 @@ StgFunPtr StgReturn(void)
* */
-static void GNUC3_ATTRIBUTE(used)
+static void STG_USED
StgRunIsImplementedInAssembler(void)
{
__asm__ volatile (
@@ -372,7 +372,7 @@ stack unwinding.
*/
-static void GNUC3_ATTRIBUTE(used)
+static void STG_USED
StgRunIsImplementedInAssembler(void)
{
__asm__ volatile (
@@ -595,7 +595,7 @@ StgRunIsImplementedInAssembler(void)
// This version is for PowerPC Linux.
-static void GNUC3_ATTRIBUTE(used)
+static void STG_USED
StgRunIsImplementedInAssembler(void)
{
__asm__ volatile (
@@ -698,7 +698,7 @@ StgRunIsImplementedInAssembler(void)
* the TOC pointer from the function descriptor upon a call to StgReturn.
* That TOC pointer is the same as the TOC pointer in StgRun.
*/
-static void GNUC3_ATTRIBUTE(used)
+static void STG_USED
StgRunIsImplementedInAssembler(void)
{
__asm__ volatile (
diff --git a/rts/include/Stg.h b/rts/include/Stg.h
index 26010db7b6..8e36bf6fab 100644
--- a/rts/include/Stg.h
+++ b/rts/include/Stg.h
@@ -220,6 +220,7 @@
#endif
#define STG_UNUSED GNUC3_ATTRIBUTE(__unused__)
+#define STG_USED GNUC3_ATTRIBUTE(__used__)
/* Prevent functions from being optimized.
See Note [Windows Stack allocations] */