]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gcov: disable tree-loop-im to reduce stack usage
authorArnd Bergmann <arnd@arndb.de>
Mon, 25 Apr 2016 15:35:30 +0000 (17:35 +0200)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 Sep 2016 11:30:15 +0000 (13:30 +0200)
commit2d291fde5f706ac081e8cfc0ebe7e31dd534dfe7
tree2a943616c3449e5c7b92690e8feb938a83e3cab6
parent2e9f201da63e83205973e093bd58c3ede6c8d862
gcov: disable tree-loop-im to reduce stack usage

commit c87bf431448b404a6ef5fbabd74c0e3e42157a7f upstream.

Enabling CONFIG_GCOV_PROFILE_ALL produces us a lot of warnings like

lib/lz4/lz4hc_compress.c: In function 'lz4_compresshcctx':
lib/lz4/lz4hc_compress.c:514:1: warning: the frame size of 1504 bytes is larger than 1024 bytes [-Wframe-larger-than=]

After some investigation, I found that this behavior started with gcc-4.9,
and opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69702.
A suggested workaround for it is to use the -fno-tree-loop-im
flag that turns off one of the optimization stages in gcc, so the
code runs a little slower but does not use excessive amounts
of stack.

We could make this conditional on the gcc version, but I could not
find an easy way to do this in Kbuild and the benefit would be
fairly small, given that most of the gcc version in production are
affected now.

I'm marking this for 'stable' backports because it addresses a bug
with code generation in gcc that exists in all kernel versions
with the affected gcc releases.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Makefile