On Wed, 9 Jul 2025 12:01:14 +0200 Jens Remus <jremus@xxxxxxxxxxxxx> wrote: > > static int unwind_user_next(struct unwind_user_state *state) > > { > > - /* no implementation yet */ > > + struct unwind_user_frame *frame; > > + unsigned long cfa = 0, fp, ra = 0; > > + unsigned int shift; > > + > > + if (state->done) > > + return -EINVAL; > > + > > + if (fp_state(state)) > > + frame = &fp_frame; > > + else > > + goto done; > > + > > + if (frame->use_fp) { > > + if (state->fp < state->sp) > > if (state->fp <= state->sp) > > I meanwhile came to the conclusion that for architectures, such as s390, > where SP at function entry == SP at call site, the FP may be equal to > the SP. At least for the brief period where the FP has been setup and > stack allocation did not yet take place. For most architectures this > can probably only occur in the topmost frame. For s390 the FP is setup > after static stack allocation, so --fno-omit-frame-pointer would enforce > FP==SP in any frame that does not perform dynamic stack allocation.