[PATCH] D116589: Don't override __attribute__((no_stack_protector)) by inlining

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 4 14:17:51 PST 2022


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

The refined behavior looks good to me. I think GCC folks focused on the optimization part (whether inlining is suppressed) but ssp conveys some security hardening semantics (inlining can lose protection) so is unusual.



================
Comment at: llvm/docs/LangRef.rst:1994
 
-    A function with the ``ssp`` attribute but without the ``alwaysinline``
-    attribute cannot be inlined into a function without a
----------------
I think the comments are still useful. It is less about semantic requirement, but about the behavior which users may want to know.

Upgrading ssp/sspstrong/sspreq level is like an implementation compromise in the absence of instruction-level (fine-grained) ssp as we only have function attributes.


================
Comment at: llvm/test/ThinLTO/X86/nossp.ll:26
 define void @nossp_caller() {
-; CHECK-LABEL: @nossp_caller
+; CHECK: define void @nossp_caller()
+; CHECK-NOT: #0
----------------
CHECK-LABEL is useful. The diagnostic is better if the `CHECK-NOT` fails.


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

https://reviews.llvm.org/D116589



More information about the llvm-commits mailing list