[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <870e7908-113c-0eed-264e-8a9832202bfe@opensource.cirrus.com>
Date: Fri, 23 Jul 2021 17:15:00 +0100
From: Richard Fitzgerald <rf@...nsource.cirrus.com>
To: Petr Mladek <pmladek@...e.com>
CC: <kbuild-all@...ts.01.org>, <linux-kernel@...r.kernel.org>,
kernel test robot <lkp@...el.com>,
- <patches@...nsource.cirrus.com>
Subject: Re: lib/test_scanf.c:531:1: warning: the frame size of 2080 bytes is
larger than 2048 bytes
On 13/07/2021 09:21, kernel test robot wrote:
> All warnings (new ones prefixed by >>):
>
> lib/test_scanf.c: In function 'numbers_list_field_width_val_width':
>>> lib/test_scanf.c:531:1: warning: the frame size of 2080 bytes is larger than 2048 bytes [-Wframe-larger-than=]
> 531 | }
> | ^
> lib/test_scanf.c: In function 'numbers_list_field_width_typemax':
> lib/test_scanf.c:489:1: warning: the frame size of 2552 bytes is larger than 2048 bytes [-Wframe-larger-than=]
> 489 | }
> | ^
> lib/test_scanf.c: In function 'numbers_list':
> lib/test_scanf.c:438:1: warning: the frame size of 2080 bytes is larger than 2048 bytes [-Wframe-larger-than=]
> 438 | }
> | ^
>
I haven't been able to reproduce this. I've tried these compilers:
Linaro AArch32 GCC 10.2.1 20201103(-O2 or -Os optimization): stack
frames < 200 bytes
Linaro ARM32 7.5-2019.12 -Os: maximum of 384 bytes
Debian 6.3.0-18+deb9u1, x86_64 -O2: frames < 200 bytes
(The GCC fetched with the reproduction instructions from the krobot
report doesn't work on my Debian system.)
The sizes reported by the krobot are the total of all stack variable in
the function, but they all have limited scope. Obviously my GCC versions
are optimizing by effectively making a union of stack variable that are
used in different scope. So presumably the GCC version used by krobot is
missing this optimization. That feels to me more like a compiler bug if
it is allocating 12 times more stack than is actually necessary for the
function.
Output from my 10.2.1 compiler (-O2):
lib/test_scanf.c: In function 'numbers_list_field_width_val_width':
lib/test_scanf.c:530:1: warning: the frame size of 176 bytes is larger
than 128 bytes [-Wframe-larger-than=]
530 | }
| ^
lib/test_scanf.c: In function 'numbers_list_field_width_typemax':
lib/test_scanf.c:488:1: warning: the frame size of 184 bytes is larger
than 128 bytes [-Wframe-larger-than=]
488 | }
| ^
lib/test_scanf.c: In function 'numbers_list':
lib/test_scanf.c:437:1: warning: the frame size of 168 bytes is larger
than 128 bytes [-Wframe-larger-than=]
Powered by blists - more mailing lists