public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/104042] New: Four memcpy/memset analyzer failures on darwin
Date: Sat, 15 Jan 2022 14:03:01 +0000	[thread overview]
Message-ID: <bug-104042-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104042

            Bug ID: 104042
           Summary: Four memcpy/memset analyzer failures on darwin
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org
  Target Milestone: ---

Created attachment 52202
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52202&action=edit
Preprocessed source

Some analyzer testcases fail on darwin
(https://gcc.gnu.org/pipermail/gcc-testresults/2022-January/747918.html) due to
what I believe are false positive.

Those four cases fail for the same reason:

gcc.dg/analyzer/data-model-1.c
gcc.dg/analyzer/pr103526.c
gcc.dg/analyzer/taint-size-1.c
gcc.dg/analyzer/write-to-string-literal-1.c

The failures are related to memcpy and memset, and can be reduced to this:

$ cat write-to-string-literal-1.c 
#include <string.h>

void test_2 (void) {
  memcpy ("abc", "def", 3); /* { dg-warning "write to string literal" } */
}
$ ./bin/gcc -fdiagnostics-plain-output -fanalyzer -Wanalyzer-too-complex
-fanalyzer-call-summaries write-to-string-literal-1.c -c

No warning is emitted, and the test expects a warning. The preprocessed source
for this reduced testcase is attached.


The testcase passes if the memcpy() call is replaced by __builtin_memcpy().

             reply	other threads:[~2022-01-15 14:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-15 14:03 fxcoudert at gcc dot gnu.org [this message]
2022-01-15 14:05 ` [Bug analyzer/104042] " fxcoudert at gcc dot gnu.org
2022-01-15 14:23 ` iains at gcc dot gnu.org
2022-01-15 14:24 ` iains at gcc dot gnu.org
2022-01-15 21:50 ` pinskia at gcc dot gnu.org
2023-08-19 21:29 ` fxcoudert at gcc dot gnu.org
2023-11-03 13:21 ` fxcoudert at gcc dot gnu.org
2024-04-01 13:27 ` cvs-commit at gcc dot gnu.org
2024-04-20 14:46 ` cvs-commit at gcc dot gnu.org
2024-04-28 14:43 ` cvs-commit 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-104042-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: 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).