public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "arnd at linaro dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/110074] New: code bloat with -fprofile-args + -fsanitize=bounds Date: Thu, 01 Jun 2023 10:12:21 +0000 [thread overview] Message-ID: <bug-110074-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110074 Bug ID: 110074 Summary: code bloat with -fprofile-args + -fsanitize=bounds Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: arnd at linaro dot org CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org Target Milestone: --- Created attachment 55231 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55231&action=edit simplified standalone version of linux kernel twofish cipher I noticed warnings about excessive stack usage in the Linux kernel in multiple files when both UBSAN and GCOV are enabled: crypto/twofish_common.c:683:1: error: the frame size of 2040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c:1589:1: error: the frame size of 1696 bytes is larger than 1400 bytes [-Werror=frame-larger-than=] drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c:754:1: error: the frame size of 1260 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] drivers/staging/media/rkvdec/rkvdec-vp9.c:1042:1: error: the frame size of 2176 bytes is larger than 2048 bytes [-Werror=frame-larger-than=] This shows up across architectures in certain kernel configurations, but I have managed to come up with a simplified testcase based on the twofish cipher that lets me reproduce this in all gcc versions I tried (gcc-5.5 through 13.1): $ gcc-13 -O2 -Wframe-larger-than=100 -fprofile-arcs -fsanitize=bounds -fsanitize=thread -c twofish.c twofish.c: In function ‘__twofish_setkey’: twofish.c:662:1: warning: the frame size of 2320 bytes is larger than 100 bytes [-Wframe-larger-than=] Removing either the -fprofile-arcs or the -fsanitize=bounds option avoids this and produces more readable code. See https://godbolt.org/z/zvf7YqK5K for a demonstration using the attached testcase. Nick Desaulniers pointed out a recent change to LLVM that addresses a similar problem by not trying to sanitize code that was generated by gcov, see https://reviews.llvm.org/D150460
next reply other threads:[~2023-06-01 10:12 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-06-01 10:12 arnd at linaro dot org [this message] 2023-06-01 13:32 ` [Bug gcov-profile/110074] code bloat with -fprofile-arcs " pinskia at gcc dot gnu.org 2023-06-01 13:49 ` [Bug gcov-profile/110074] -fprofile-arcs profiles arcs generated by -fsanitize=bounds pinskia at gcc dot gnu.org 2023-06-02 7:51 ` rguenth at gcc dot gnu.org
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=bug-110074-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).