diff options
author | Ben Elliston <bje@au.ibm.com> | 2009-11-30 10:19:20 +0000 |
---|---|---|
committer | Ben Elliston <bje@gcc.gnu.org> | 2009-11-30 21:19:20 +1100 |
commit | 2fc5ecb5a8bb3ebc7fad471a0dbd40939c6885e0 (patch) | |
tree | f00f0324fb3168635e4416794446e29c58bfb4f6 /boehm-gc/mark_rts.c | |
parent | 0761b46075f1c53a0fc01292b1956dd95137e18e (diff) | |
download | gcc-2fc5ecb5a8bb3ebc7fad471a0dbd40939c6885e0.zip gcc-2fc5ecb5a8bb3ebc7fad471a0dbd40939c6885e0.tar.gz gcc-2fc5ecb5a8bb3ebc7fad471a0dbd40939c6885e0.tar.bz2 |
mark_rts.c (GC_approx_sp): Use __builtin_frame_address when compiling with GCC rather than taking the...
* mark_rts.c (GC_approx_sp): Use __builtin_frame_address when
compiling with GCC rather than taking the address of a local
variable.
From-SVN: r154771
Diffstat (limited to 'boehm-gc/mark_rts.c')
-rw-r--r-- | boehm-gc/mark_rts.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/boehm-gc/mark_rts.c b/boehm-gc/mark_rts.c index 4074879..7a9fb8f 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 |