This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/83356] [7 Regression] excessive stack usage compiling with -O2 -fsanitize=bounds -fsanitize=object-size
- From: "arnd at linaro dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Dec 2017 15:10:14 +0000
- Subject: [Bug sanitizer/83356] [7 Regression] excessive stack usage compiling with -O2 -fsanitize=bounds -fsanitize=object-size
- Auto-submitted: auto-generated
- References: <bug-83356-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356
--- Comment #5 from Arnd Bergmann <arnd at linaro dot org> ---
(In reply to Richard Biener from comment #3)
> That said, can't see an easy workaround but to change the source and/or
> not use -fsanitize= and expect decent code quality.
I don't see a good way to modify the source code without risking performance
regressions in other configurations (arch, compiler version or flags), and the
AES cipher is a rather performance critical part of the kernel.
I have experimentally shown that passing either -fno-tree-sra and/or
-fno-tree-pre improves the stack usage in this file significantly (312 bytes
with ubsan, 192 bytes without), though it's still around twice as much as with
gcc-7.1.1, both with and without sanitizers.
I have not yet tried to analyze or measure the resulting object code though.