Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / libgc / mark_rts.c
index 4074879a71aa90d1f8e638b9ce7521573939bfb4..561333ab04d672ca249142e11a2b77654adbee38 100644 (file)
@@ -368,6 +368,9 @@ ptr_t p;
 
 ptr_t GC_approx_sp()
 {
+#if defined(__GNUC__)
+    return __builtin_frame_address(0);
+#else
     VOLATILE word dummy;
 
     dummy = 42;        /* Force stack to grow if necessary.    Otherwise the   */
@@ -380,6 +383,7 @@ ptr_t GC_approx_sp()
 #   ifdef _MSC_VER
 #     pragma warning(default:4172)
 #   endif
+#endif  // __GNUC__
 }
 
 /*