public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/102697] New: [Diagnostics] overflow warning missing after O2 vectorization.
@ 2021-10-12  2:23 crazylht at gmail dot com
  2021-10-12  7:14 ` [Bug middle-end/102697] " crazylht at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: crazylht at gmail dot com @ 2021-10-12  2:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102697
           Summary: [Diagnostics] overflow warning missing after O2
                    vectorization.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
                CC: msebor at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

testcase is from Wstringop-overflow-76.c

It looks to me the testcase is not well written since variable i here could be
negative value, and d[6] may not overflow.

#define MAX(p, q) ((p) > (q) ? (p) : (q))
struct B4_B6
{
  char b4[4];
  char b6[6];       // { dg-message "at offset 6 into destination object 'b6'
of size 6" "note" }
};

void max_B6_B4 (int i, struct B4_B6 *pb4_b6)
{
char *p = pb4_b6->b6 + i;
char *q = pb4_b6->b4 + i;
  char *d = MAX (p, q);

  d[3] = 0;
  d[4] = 0;
  d[5] = 0;
  d[6] = 0;         // { dg-warning "writing 1 byte into a region of size 0 " }
}

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-05-08 12:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12  2:23 [Bug middle-end/102697] New: [Diagnostics] overflow warning missing after O2 vectorization crazylht at gmail dot com
2021-10-12  7:14 ` [Bug middle-end/102697] " crazylht at gmail dot com
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

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).