lkml.org 
[lkml]   [2021]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: lib/test_scanf.c:531:1: warning: the frame size of 2080 bytes is larger than 2048 bytes
From
Date
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=]

\
 
 \ /
  Last update: 2021-07-23 18:16    [W:0.050 / U:1.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site