[PATCH] D146339: [StackProtector] attribute __stack_chk_fail as NoReturn

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 11:02:14 PDT 2023


nickdesaulniers added inline comments.


================
Comment at: llvm/lib/CodeGen/StackProtector.cpp:611
+  B.CreateCall(StackChkFail, Args);
   B.CreateUnreachable();
   return FailBB;
----------------
@efriedma I wonder if we can avoid this unreachable? (maybe as a follow up commit to this)

I had tried it and a bunch of stack check related tests crashed; I didn't investigate, but suspect maybe some other code expects there to be an instruction after the call.

Or can you think of any reason why an unreachable needs to be added here?  Is there something implicit about noreturn functions needing to be followed by unreachable in IR?

(even if the child patches don't land, D146339 alone is still probably worthwhile to land)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146339/new/

https://reviews.llvm.org/D146339



More information about the llvm-commits mailing list