[Bug sanitizer/81715] asan-stack=1 redzone allocation is too inflexible
arnd at linaro dot org
gcc-bugzilla@gcc.gnu.org
Fri Sep 15 16:03:00 GMT 2017
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.
More information about the Gcc-bugs
mailing list