__builtin_return_address

Eli Zaretskii eliz@delorie.com
Wed Nov 1 23:41:00 GMT 2000


> From: Michael Meissner <meissner@cygnus.com>
> Date: Wed, 1 Nov 2000 16:03:44 -0500
> > 
> > Also, is the platform the OP was talking about (Red Hat GNU/Linux)
> > really one of those where __builtin_return_address doesn't work?
> 
> Ummm, Red Hat GNU/Linux runs on 3 different target hardwares.  For the x86,
> __builtin_return_address with a non-zero argument only has a chance of working
> if the caller was not called with -fomit-frame-pointer.

The original message indicates that it was an x86-based system:

    Reading specs from
    usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs/
    gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

It also indicates that -fomit-frame-pointer was not used:

    On my machine, this program compiled with 'gcc
    watchtest6.c  -o watchtest6' when run returns:

    400349cb
    8048361


More information about the Gcc-bugs mailing list