public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105080] Bugus -Wformat-truncation Date: Mon, 28 Mar 2022 10:46:26 +0000 [thread overview] Message-ID: <bug-105080-4-OrdYB6bvDE@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105080-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105080 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |diagnostic Ever confirmed|0 |1 Last reconfirmed| |2022-03-28 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. The issue is that at -O0 we do not use SCEV and thus range analysis is limited, just using i < 16. static unsigned int printf_strlen_execute (function *fun, bool warn_only) { strlen_optimize = !warn_only; calculate_dominance_info (CDI_DOMINATORS); bool use_scev = optimize > 0 && flag_printf_return_value; if (use_scev) { loop_optimizer_init (LOOPS_NORMAL); scev_initialize (); } at -O0 we call this when warn_format_overflow > 0 || warn_format_trunc > 0 so to improve we could maybe do || warn_only above. That would fix the bogus diagnostic.
next prev parent reply other threads:[~2022-03-28 10:46 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-28 10:19 [Bug c/105080] New: " marcandre.lureau at gmail dot com 2022-03-28 10:46 ` rguenth at gcc dot gnu.org [this message] 2022-03-28 10:50 ` [Bug c/105080] " rguenth at gcc dot gnu.org 2022-03-28 12:49 ` [Bug tree-optimization/105080] [12 Regression] " rguenth at gcc dot gnu.org 2022-03-28 12:55 ` rguenth at gcc dot gnu.org 2022-03-29 6:15 ` cvs-commit at gcc dot gnu.org 2022-03-29 6:18 ` 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-105080-4-OrdYB6bvDE@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).