Thread (10 messages) flat view 10 messages, 4 authors, 2022-12-19

Re: [PATCH] powerpc/64: Implement arch_within_stack_frames

From: Segher Boessenkool <hidden>
Date: 2022-12-15 00:20:09

On Wed, Dec 14, 2022 at 09:39:25PM +1000, Nicholas Piggin wrote:
What about just copying x86's implementation including using
__builtin_frame_address(1/2)? Are those builtins reliable for all
our targets and compiler versions?
__builtin_frame_address(n) with n > 0 is specifically not supported, not
on any architecture; it does not work in all situations on *any* arch,
and not in *any* situation on some archs.

This is clearly documented:

     Calling this function with a nonzero argument can have
     unpredictable effects, including crashing the calling program.  As
     a result, calls that are considered unsafe are diagnosed when the
     '-Wframe-address' option is in effect.  Such calls should only be
     made in debugging situations.

(and that warning is enabled by -Wall).


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help