public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "siddhesh at gotplt dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/101397] [11 Regression] spurious warning writing to the result of stpcpy minus 1
Date: Tue, 26 Oct 2021 14:24:12 +0000	[thread overview]
Message-ID: <bug-101397-4-TfNApp6aaS@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101397-4@http.gcc.gnu.org/bugzilla/>

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

Siddhesh Poyarekar <siddhesh at gotplt dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |siddhesh at gotplt dot org

--- Comment #7 from Siddhesh Poyarekar <siddhesh at gotplt dot org> ---
(In reply to CVS Commits from comment #4)
> The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:
> 
> https://gcc.gnu.org/g:8bf5b49ebd2176b8c535147377381dd07fbdd643
> 
> commit r12-2422-g8bf5b49ebd2176b8c535147377381dd07fbdd643
> Author: Martin Sebor <msebor@redhat.com>
> Date:   Tue Jul 20 13:48:20 2021 -0600
> 
>     Correct stpcpy offset computation for -Warray-bounds et al. [PR101397].

This causes a crash with the following program due to an infinite recursion:

typedef __SIZE_TYPE__ size_t;

void
__attribute__ ((noinline))
foo (size_t x)
{
  struct T { char buf[64]; char buf2[64]; } t;
  char *p = &t.buf[8];
  char *r = t.buf2;
  size_t i;

  for (i = 0; i < x; i++)
    {
      r = __builtin_mempcpy (r, p, i);
      p = r + 1;
    }
}

$ cc1.r12-2422 -quiet -o - repro.c 
        .file   "repro.c"
        .text
Segmentation fault (core dumped)

  parent reply	other threads:[~2021-10-26 14:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 18:23 [Bug middle-end/101397] New: " msebor at gcc dot gnu.org
2021-07-09 18:25 ` [Bug middle-end/101397] [11/12 Regression] " msebor at gcc dot gnu.org
2021-07-12 17:20 ` msebor at gcc dot gnu.org
2021-07-15  1:50 ` msebor at gcc dot gnu.org
2021-07-20 19:52 ` cvs-commit at gcc dot gnu.org
2021-07-20 19:53 ` [Bug middle-end/101397] [11 " msebor at gcc dot gnu.org
2021-07-28  7:07 ` rguenth at gcc dot gnu.org
2021-10-26 14:24 ` siddhesh at gotplt dot org [this message]
2021-11-09  0:06 ` msebor at gcc dot gnu.org
2021-12-09 16:58 ` msebor at gcc dot gnu.org
2022-04-21  7:49 ` rguenth at gcc dot gnu.org
2023-05-29 10:05 ` jakub 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-101397-4-TfNApp6aaS@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).