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/106302] New: RFE: provide a way for -fanalyzer to use target flags Date: Thu, 14 Jul 2022 15:35:19 +0000 [thread overview] Message-ID: <bug-106302-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106302 Bug ID: 106302 Summary: RFE: provide a way for -fanalyzer to use target flags Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: dmalcolm at gcc dot gnu.org Blocks: 106003, 106301 Target Milestone: --- As noted in the discussion here: https://gcc.gnu.org/pipermail/gcc/2022-June/238954.html -fanalyzer sometimes uses specific target flags when modeling the behavior of functions, see e.g.: sm-fd.cc, which currently has: enum access_mode fd_state_machine::get_access_mode_from_flag (int flag) const { /* FIXME: this code assumes the access modes on the host and target are the same, which in practice might not be the case. */ if ((flag & O_ACCMODE) == O_RDONLY) { return READ_ONLY; } else if ((flag & O_ACCMODE) == O_WRONLY) { return WRITE_ONLY; } return READ_WRITE; } where we are using the values of O_ACCMODE, O_RDONLY, and O_WRONLY from the host's headers, rather than those of the target. See also bug 106301, where properly supporting mmap would mean looking at values of MAP_ANONYMOUS, and of the various PROT_ values. Joseph suggested adding a target hook for this, though I think we'd need an enum for it, so that we can add various different "well known" values that we'd want to query for on the host. Alternatively, perhaps we could directly query the preprocessor somehow, though that wouldn't work for the LTO case. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106003 [Bug 106003] RFE: -fanalyzer could complain about misuse of file-descriptors https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106301 [Bug 106301] RFE: analyzer support of mmap
next reply other threads:[~2022-07-14 15:35 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-14 15:35 dmalcolm at gcc dot gnu.org [this message] 2022-11-02 15:12 ` [Bug analyzer/106302] " dmalcolm at gcc dot gnu.org 2022-11-15 18:59 ` cvs-commit at gcc dot gnu.org 2022-11-15 19:11 ` dmalcolm at gcc dot gnu.org 2022-11-28 22:20 ` pinskia 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-106302-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).