https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85334
H.J. Lu <hjl.tools at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- --- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> --- CET kernel has been changed to place a restore token on shadow stack for signal handler to enhance security. It is usually transparent to user programs since kernel will pop the restore token when signal handler returns. But when an exception is thrown from a signal handler, now we need to pop the the restore token. Otherwise, we get FAIL: g++.dg/torture/pr85334.C -O0 execution test FAIL: g++.dg/torture/pr85334.C -O1 execution test FAIL: g++.dg/torture/pr85334.C -O2 execution test FAIL: g++.dg/torture/pr85334.C -O3 -g execution test FAIL: g++.dg/torture/pr85334.C -Os execution test FAIL: g++.dg/torture/pr85334.C -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test I am testing this patch: diff --git a/libgcc/config/i386/shadow-stack-unwind.h b/libgcc/config/i386/shadow-stack-unwind.h index a32f3e74b52..40f48df2aec 100644 --- a/libgcc/config/i386/shadow-stack-unwind.h +++ b/libgcc/config/i386/shadow-stack-unwind.h @@ -49,8 +49,3 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see } \ } \ while (0) - -/* Increment frame count. Skip signal frames. */ -#undef _Unwind_Frames_Increment -#define _Unwind_Frames_Increment(context, frames) \ - if (!_Unwind_IsSignalFrame (context)) frames++