public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub 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: Mon, 20 Apr 2020 08:52:12 +0000	[thread overview]
Message-ID: <bug-94655-4-rfig8jZF0r@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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We must have dups for this, the warning relies on something that the IL doesn't
provide. fre4 changes:
   _8 = &MEM[(struct A *)_5 + 8B].strA;
   std::__cxx11::basic_string<char>::_M_assign (_8, &D.113592.strA);

   <bb 3> [local count: 1073741824]:
   _9 = &MEM[(struct A *)_5 + 8B].arr;
-  _31 = &MEM[(struct A *)_5 + 8B];
-  _29 = _31 + 32;
-  _24 = &D.113592 + 33;
-  _21 = _29 - _24;
+  _29 = _8 + 32;
+  _21 = _29 - &MEM <const struct A> [(void *)&D.113592 + 33B];
...
-  vectp.110_64 = &D.113592 + 32;
-  _69 = &MEM[(struct A *)_5 + 8B];
-  vectp.113_68 = _69 + 32;
-  vect__13.111_67 = MEM <const vector(16) char> [(const char *)vectp.110_64];
-  MEM <vector(16) char> [(char *)vectp.113_68] = vect__13.111_67;
-  vectp.109_66 = vectp.110_64 + 16;
-  vectp.112_71 = vectp.113_68 + 16;
-  ivtmp_74 = 1;
+  vect__13.111_67 = MEM <const vector(16) char> [(const char *)&D.113592 +
32B];
+  MEM <vector(16) char> [(char *)_29] = vect__13.111_67;
+  vectp.112_71 = _29 + 16;

and the warning warns because it thinks the store uses the strA + 32 pointer to
store the 16 bytes (vectorized), but the user code doesn't do that, only the
value numbering found that the value is equal to that.

Perhaps SCCVN could try to modify the &something.field into &MEM_REF[..., off]
if it decides to reuse it in some context that doesn't use the same field base,
but not sure how hard would that be.

  parent reply	other threads:[~2020-04-20  8:52 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 [this message]
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
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-rfig8jZF0r@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).