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/94655] [10 Regression] Implicit assignment operator triggers stringop-overflow warning since r10-5451-gef29b12cfbb4979a
Date: Tue, 21 Apr 2020 21:27:53 +0000	[thread overview]
Message-ID: <bug-94655-4-gHA3kF5WXm@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94655-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
         Resolution|DUPLICATE                   |---

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
The root cause in this case or the solution are not the same as in bug 94675. 
The MEM_REF type is the type of the access, so it's correct to rely on it for
the size of the access.  The problem here is that the first MEM_REF pointer
operand doesn't point to the actual destination of the access: it points to one
member of the struct but as a result of adding the offset to it the access is
actually to the subsequent member.  It's as if the final store in valid code
like this:

  struct S { char i; char a[8], b[8]; };

  void g (struct S *p)
  {
    typedef __attribute__ ((vector_size (8))) char V;

    char *pa = p->a + 8;
    char *pb = p->b;

    *(V*)pb = (V) {0};   // pb points to p->b
  }

were transformed into:

  pa_2 = &MEM <char[8]> [(void *)p_1(D) + 9B];
  MEM[(V *)pa_2] = { 0, 0, 0, 0, 0, 0, 0, 0 };   // but here store is into
(p->a + 9)

  parent reply	other threads:[~2020-04-21 21:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 23:35 [Bug c++/94655] New: Implicit assignment operator triggers stringop-overflow warning drahflow at gmx dot de
2020-04-20  7:10 ` [Bug tree-optimization/94655] [10 Regression] " rguenth at gcc dot gnu.org
2020-04-20  7:24 ` [Bug tree-optimization/94655] [10 Regression] Implicit assignment operator triggers stringop-overflow warning since r10-5451-gef29b12cfbb4979a marxin at gcc dot gnu.org
2020-04-20  8:52 ` jakub at gcc dot gnu.org
2020-04-20 15:35 ` msebor at gcc dot gnu.org
2020-04-20 15:42 ` jakub at gcc dot gnu.org
2020-04-20 16:57 ` msebor at gcc dot gnu.org
2020-04-21 20:10 ` law at redhat dot com
2020-04-21 21:27 ` msebor at gcc dot gnu.org [this message]
2020-04-30 16:14 ` [Bug tree-optimization/94655] [10/11 " msebor at gcc dot gnu.org
2020-05-07 11:56 ` jakub at gcc dot gnu.org
2020-07-21 14:55 ` msebor at gcc dot gnu.org
2020-07-21 20:08 ` msebor at gcc dot gnu.org
2020-07-21 20:46 ` pinskia at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2021-01-14  8:38 ` rguenth at gcc dot gnu.org
2021-01-14 20:11 ` msebor at gcc dot gnu.org
2021-01-21 22:34 ` [Bug tree-optimization/94655] [10/11 Regression] -Wstringop-overflow on implicit string assignment with vectorized char store msebor at gcc dot gnu.org
2021-01-21 23:48 ` msebor at gcc dot gnu.org
2021-03-04  0:05 ` cvs-commit at gcc dot gnu.org
2021-04-08 12:02 ` [Bug tree-optimization/94655] [10 " rguenth at gcc dot gnu.org
2022-03-17 19:54 ` msebor at gcc dot gnu.org
2022-06-28 10:40 ` jakub at gcc dot gnu.org
2023-07-07  8:49 ` rguenth 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-94655-4-gHA3kF5WXm@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).