mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Petr Mladek <pmladek@suse.com>
Cc: <kbuild-all@lists.01.org>, <linux-kernel@vger.kernel.org>,
	kernel test robot <lkp@intel.com>,
	- <patches@opensource.cirrus.com>
Subject: Re: lib/test_scanf.c:531:1: warning: the frame size of 2080 bytes is larger than 2048 bytes
Date: Fri, 23 Jul 2021 17:15:00 +0100	[thread overview]
Message-ID: <870e7908-113c-0eed-264e-8a9832202bfe@opensource.cirrus.com> (raw)
In-Reply-To: <202107131602.8qHTzV8q-lkp@intel.com>

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=]

  reply	other threads:[~2021-07-23 16:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  8:21 kernel test robot
2021-07-23 16:15 ` Richard Fitzgerald [this message]
2021-07-27  9:01   ` [kbuild-all] " Chen, Rong A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=870e7908-113c-0eed-264e-8a9832202bfe@opensource.cirrus.com \
    --to=rf@opensource.cirrus.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=patches@opensource.cirrus.com \
    --cc=pmladek@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome