]> granicus.if.org Git - gc/commitdiff
* mark_rts.c (GC_approx_sp): Use __builtin_frame_address when
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Nov 2009 10:19:20 +0000 (10:19 +0000)
committerguest <ivmai@mail.ru>
Fri, 29 Jul 2011 06:54:29 +0000 (10:54 +0400)
compiling with GCC rather than taking the address of a local
variable.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154771 138bc75d-0d04-0410-961f-82ee72b054a4

ChangeLog
mark_rts.c

index 5b615d956a426e1293b56eb188d5e0b4c10ac9ae..03e51589580921e32336b8a4f238e4ad41664a38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-30  Ben Elliston  <bje@au.ibm.com>
+
+       * mark_rts.c (GC_approx_sp): Use __builtin_frame_address when
+       compiling with GCC rather than taking the address of a local
+       variable.
+
 2009-11-30  Ben Elliston  <bje@au.ibm.com>
 
        * os_dep.c: Use the POSIX signal API in preference to the BSD API.
index 4074879a71aa90d1f8e638b9ce7521573939bfb4..7a9fb8f2b7215f4d215b7413fc0795d0767c9d9a 100644 (file)
@@ -376,7 +376,13 @@ ptr_t GC_approx_sp()
 #   ifdef _MSC_VER
 #     pragma warning(disable:4172)
 #   endif
-    return((ptr_t)(&dummy));
+#ifdef __GNUC__
+    /* Eliminate a warning from GCC about taking the address of a
+       local variable.  */
+    return __builtin_frame_address (0);
+#else
+    return ((ptr_t)(&dummy));
+#endif /* __GNUC__ */
 #   ifdef _MSC_VER
 #     pragma warning(default:4172)
 #   endif