public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/102466] -O3 -fsanitize=undefined causes warnings  (writing 2 bytes into a region of size 0)
Date: Mon, 27 Sep 2021 21:37:30 +0000	[thread overview]
Message-ID: <bug-102466-4-1ks3cOZhD9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102466-4@http.gcc.gnu.org/bugzilla/>

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |msebor at gcc dot gnu.org
   Last reconfirmed|                            |2021-09-27
             Blocks|                            |88443
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  As Martin indicated in comment #1, the UBSAN sanitization is
causing the warning to trigger.  The IL the first instance is issued for is
below (-fdump-tree-strlen):

  if (iter_554 == 0B)
    goto <bb 31>; [0.00%]
  else
    goto <bb 32>; [100.00%]

  <bb 31> [count: 0]:
  __builtin___ubsan_handle_nonnull_arg (&*.Lubsan_data478);

  <bb 32> [local count: 850510933]:
  if (_560 == 0B)
    goto <bb 33>; [0.00%]
  else
    goto <bb 34>; [100.00%]

  <bb 33> [count: 0]:
  __builtin___ubsan_handle_nonnull_arg (&*.Lubsan_data479);

  <bb 34> [local count: 850510933]:                               <<< iter_554
is null
  _565 = MEM <short unsigned int> [(char * {ref-all})_558];
  MEM <short unsigned int> [(char * {ref-all})iter_554] = _565;   <<<
-Wstringop-overflow
  .UBSAN_PTR (iter_554, 2);

The problem is likely a duplicate of one of the existing reports of the same
problem.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
[Bug 88443] [meta-bug] bogus/missing -Wstringop-overflow warnings

  parent reply	other threads:[~2021-09-27 21:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  7:08 [Bug c++/102466] New: " unlvsur at live dot com
2021-09-27 14:00 ` [Bug tree-optimization/102466] " marxin at gcc dot gnu.org
2021-09-27 21:37 ` msebor at gcc dot gnu.org [this message]
2022-03-29 14:20 ` mathieu.malaterre at gmail dot com
2022-03-29 14:22 ` mathieu.malaterre at gmail dot com

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-102466-4-1ks3cOZhD9@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).