This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/81996] powerpc __builtin_return_address(0) fails with -fPIC -fstack-protector-all or -fsanitize=address


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81996

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|__builtin_return_address(0) |powerpc
                   |does not work on powerpc in |__builtin_return_address(0)
                   |-fPIC -fstack-protector-all |fails with -fPIC
                   |mode and causes SIGSEGVs    |-fstack-protector-all or
                   |                            |-fsanitize=address

--- Comment #6 from Alan Modra <amodra at gmail dot com> ---
It looks like this is FRAME_GROWS_DOWNWARD, which rs6000.h sets true for
flag_stack_protect.  And, yes, -fsanitize=address shows the same sort of error,
reading an offset from r1 instead of 0(r1) to get the previous frame where lr
is saved.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]