Needs GCC 12+ or Clang 9+.
To reproduce bugs, you need at least -O2 (IIRC > -O0 might work, needs inlining at least, but use -O2 please or higher), GCC 12+, or Clang 9+ (but we're mostly using GCC here).
You also need (feel free to change -O2, as above):
I instead patch GCC because it's easier.
Created attachment 781316 [details, diff]
(In reply to Sam James from comment #2)
> Created attachment 781316 [details, diff] [details, diff]
Place at /etc/portage/patches/sys-devel/gcc:12/fortify-source-3.patch.