https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84521
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Is the requirement just for functions that contain setjmp? If so, the backend could just force frame pointers in cfun->calls_setjmp functions. If not, even if the default is tweaked again to be -fno-omit-frame-pointer on aarch64, the code is still wrong with explicit -fno-omit-frame-pointer, even before that change. The test uses __builtin_setjmp, can't reproduce it when using normal setjmp, so is it just __builtin_setjmp that requires frame pointers? I think we don't really have a flag about uses of __builtin_setjmp right now, but it could be added next to calls_setjmp (calls_builtin_setjmp). Marking the function with __builtin_setjmp with __attribute__((optimize ("no-omit-frame-pointer"))) fixes it too.