diff options
author | bje <bje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 10:19:20 +0000 |
---|---|---|
committer | bje <bje@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 10:19:20 +0000 |
commit | 6665ce3784df4f1bf692785c0f79de6eaa7d6dc2 (patch) | |
tree | f00f0324fb3168635e4416794446e29c58bfb4f6 /boehm-gc | |
parent | 37c235206a9198f07d575681b7e5182c93b28c22 (diff) | |
download | gcc-6665ce3784df4f1bf692785c0f79de6eaa7d6dc2.tar.gz |
* mark_rts.c (GC_approx_sp): Use __builtin_frame_address when
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
Diffstat (limited to 'boehm-gc')
-rw-r--r-- | boehm-gc/ChangeLog | 6 | ||||
-rw-r--r-- | boehm-gc/mark_rts.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 5b615d956a4..03e51589580 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,5 +1,11 @@ 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. Generate a compilation error if neither the POSIX nor BSD APIs can be detected. diff --git a/boehm-gc/mark_rts.c b/boehm-gc/mark_rts.c index 4074879a71a..7a9fb8f2b72 100644 --- a/boehm-gc/mark_rts.c +++ b/boehm-gc/mark_rts.c @@ -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 |