This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/81715] asan-stack=1 redzone allocation is too inflexible
- From: "arnd at linaro dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 15 Sep 2017 16:03:42 +0000
- Subject: [Bug sanitizer/81715] asan-stack=1 redzone allocation is too inflexible
- Auto-submitted: auto-generated
- References: <bug-81715-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715
--- Comment #3 from Arnd Bergmann <arnd at linaro dot org> ---
(In reply to Arnd Bergmann from comment #2)
> Created attachment 42178 [details]
> preprocessed linux/drivers/media/dvb-frontends/stv090x.c, compressed
>
> This is one of the typical files showing the behavior, with stack sizes up
> to 8 KB using gcc, but only a few hundred bytes using clang:
>
Looking at it again, it was probably not the best example, in this case the
difference between clang and gcc is that clang happens to inline
stv090x_write_regs while gcc doesn't inline it. If I mark that function as
__always_inline, gcc produces good code as well, but that is a little besides
the point. In a lot of other examples the function that gets called is from
another file, so we can't inline it. I can attach a few other examples if that
helps, or you could just replace the function with an extern declaration for
testing.