public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/102697] [Diagnostics] overflow warning missing after O2 vectorization.
Date: Tue, 12 Oct 2021 07:14:51 +0000	[thread overview]
Message-ID: <bug-102697-4-uA65B2FU13@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102697-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Hongtao.liu <crazylht at gmail dot com> ---
Change i to 0, still missing warning after vectorization

before vectorization

void max_B6_B4 (int i, struct B4_B6 * pb4_b6)
{
  char * d;
  char * q;
  char * p;

  <bb 2> [local count: 1073741824]:
  [../test4.c:10:7] p_2 = [../test4.c:10:11] &[../test4.c:10:17]
pb4_b6_1(D)->b6;
  [../test4.c:11:7] q_3 = [../test4.c:11:11] &[../test4.c:11:17]
pb4_b6_1(D)->b4;
  [../test4.c:12:9] d_4 = MAX_EXPR <p_2, q_3>;
  [../test4.c:14:8] MEM <unsigned int> [(char *)d_4 + 3B] = 0;
  [../test4.c:18:1] return;

after vectorization:

;; Function max_B6_B4 (max_B6_B4, funcdef_no=0, decl_uid=4060, cgraph_uid=1,
symbol_order=0)

void max_B6_B4 (int i, struct B4_B6 * pb4_b6)
{
  char * d;
  char * q;
  char * p;

  <bb 2> [local count: 1073741824]:
  [test4.c:10:7] p_2 = [test4.c:10:11] &[test4.c:10:17] pb4_b6_1(D)->b6;
  [test4.c:11:7] q_3 = [test4.c:11:11] &[test4.c:11:17] pb4_b6_1(D)->b4;
  [test4.c:12:9] d_4 = MAX_EXPR <p_2, q_3>;
  [test4.c:14:8] MEM <vector(4) char> [(char *)d_4 + 3B] = { 0, 0, 0, 0 };
  [test4.c:18:1] return;

}
It looks like a false negative for -Wstringop-overflow=

  reply	other threads:[~2021-10-12  7:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12  2:23 [Bug middle-end/102697] New: " crazylht at gmail dot com
2021-10-12  7:14 ` crazylht at gmail dot com [this message]
2021-10-12 15:44 ` [Bug middle-end/102697] [12 Regression] overflow warning missing after -O2 vectorization msebor at gcc dot gnu.org
2021-10-12 19:14 ` pinskia at gcc dot gnu.org
2021-10-20  2:13 ` cvs-commit at gcc dot gnu.org
2021-12-16 20:00 ` msebor at gcc dot gnu.org
2022-05-06  8:31 ` [Bug middle-end/102697] [12/13 " jakub at gcc dot gnu.org
2022-07-26 13:24 ` rguenth at gcc dot gnu.org
2023-05-08 12:22 ` [Bug middle-end/102697] [12/13/14 " 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-102697-4-uA65B2FU13@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).