public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/112969] -Wanalyzer-exposure-through-uninit-copy false positive seen on Linux kernel's drivers/net/ethernet/intel/ice/ice_ptp.c Date: Wed, 24 Jan 2024 22:19:09 +0000 [thread overview] Message-ID: <bug-112969-4-1d6g5fZ7DV@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-112969-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112969 David Malcolm <dmalcolm at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 Last reconfirmed| |2024-01-24 --- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> --- Issue seems to be with compound assignments where the source struct is not at offset 0 within its binding_cluster. A simpler reproducer, which generates a -Wanalyzer-use-of-uninitialized-value: Trunk: https://godbolt.org/z/qrzqb7EeP GCC 13.2: https://godbolt.org/z/8voo1zbq6 GCC 12.3: https://godbolt.org/z/oMxTnsdv6 GCC 11.4 didn't have -Wanalyzer-use-of-uninitialized-value but still doesn't properly handle the compound assignment: https://godbolt.org/z/Ks36YddTG /* Reduced from -Wanalyzer-exposure-through-uninit-copy false positives seen in Linux kernel in drivers/net/ethernet/intel/ice/ice_ptp.c */ extern void __analyzer_eval (int); struct hwtstamp_config { int flags; int tx_type; int rx_filter; }; struct ice_ptp { long placeholder; struct hwtstamp_config tstamp_config; }; struct ice_pf { struct ice_ptp ptp; }; void ice_ptp_set_ts_config(struct ice_pf* pf) { struct hwtstamp_config config; pf->ptp.tstamp_config.tx_type = 1; pf->ptp.tstamp_config.rx_filter = 2; config = pf->ptp.tstamp_config; __analyzer_eval (config.flags == pf->ptp.tstamp_config.flags); /* { dg-warning "TRUE" } */ /* { dg-bogus "use of uninitialized value 'config.flags'" "PR analyzer/112969" { target *-*-* } .-1 } */ }
next prev parent reply other threads:[~2024-01-24 22:19 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-12-11 20:07 [Bug analyzer/112969] New: " dmalcolm at gcc dot gnu.org 2024-01-24 22:19 ` dmalcolm at gcc dot gnu.org [this message] 2024-01-25 15:07 ` [Bug analyzer/112969] " cvs-commit at gcc dot gnu.org 2024-01-25 15:11 ` dmalcolm at gcc dot gnu.org 2024-04-14 5:03 ` [Bug analyzer/112969] [11/12/13 Regression] " pinskia at gcc dot gnu.org 2024-05-09 17:11 ` cvs-commit at gcc dot gnu.org 2024-05-09 17:51 ` [Bug analyzer/112969] [11/12 " dmalcolm 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-112969-4-1d6g5fZ7DV@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).