On Wed, 01 Jul 2026, Alice Carlotti wrote:
> A general remark: there are several places in this patch in which you detect
> an
> irrelevant instruction in the prologue/epilogue and don't emit a directive.
> This seems wrong to me, because the unwind codes should map 1:1 to the
> instructions in a prologue or epilogue, so I would expect .seh_nop to be
> emitted for any irrelevant instructions in the middle of the
> prologue/epilogue.
It is not necessary to map 1:1 all instructions in prolog.
Irrelevant instructions for unwinding can be skipped.
> > + return;
> > +
> > + bool emit_single_register = false;
> > + unsigned reg_count = 1;
> > + if (callee_save_reg1 && callee_save_reg2)
> > + {
> > + emit_single_register = (regno[1] - regno[0]) != 1;
>
> If the instruction saves two non-consecutive callee-saved registers, then this
> would silently ignore one of them in the unwind data. Since we can't
> represent
> such an instruction accurately with unwind codes, we should try to ensure it
> never arises in a prologue or epilogue (perhaps we already do this), and I
> think we should either sorry or ice if we do encounter it to avoid silent
> wrong-code issues.
Non-consecutive callee-saved registers are handled by 2 unwind codes.
> > + unwind_code_suffix,
> > + reg_prefix,
> > + regno[i] - regno_offset,
> > + offset + i * offset_increment);
> > +}
> > +
> > +/* Emmit SEH directive if the pattern is recognized. */
>
> Typo: Emit.
It will be fixed.
> > +
> > +static void
> > +aarch64_seh_pattern_emit (FILE *f, struct seh_frame_state *seh, const rtx
> > pat)
> > +{
>
> This function appears to check for saving a reg pair in two different ways,
> and
> doesn't check for restoring a reg pair (whereas for single reg it checks both
> save and restore).
It looks like it is not reproducible for PARALLEL.
Regards,
Evgeny