public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/102722] New: [Disgnostic]Xpass for gcc.dg/Wstringop-overflow-68.c after O2 vectorization.
@ 2021-10-13  2:49 crazylht at gmail dot com
  2021-10-20  2:13 ` [Bug middle-end/102722] " cvs-commit at gcc dot gnu.org
  2021-12-16 18:28 ` msebor at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: crazylht at gmail dot com @ 2021-10-13  2:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102722
           Summary: [Disgnostic]Xpass for gcc.dg/Wstringop-overflow-68.c
                    after O2 vectorization.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

void warn_comp_lit (void)
{
  *(AC2*)a1 = Ac2;      // { dg-warning "writing 2 bytes into a region of size
1" "pr101475" { xfail *-*-* } }

  // and warning should be expected, refer to PR102697.
  *(AC4*)a2 = Ac4;      // { dg-warning "writing 4 bytes into a region of size
2" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
  *(AC4*)a3 = Ac4;      // { dg-warning "writing 4 bytes into a region of size
3" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
  *(AC8*)a4 = Ac8;      // { dg-warning "writing 8 bytes into a region of size
4" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
  *(AC8*)a7 = Ac8;      // { dg-warning "writing 8 bytes into a region of size
7" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
  *(AC16*)a15 = Ac16;   // { dg-warning "writing 16 bytes into a region of size
15" "pr101475" { xfail { ! { i?86-*-* x86_64-*-* } } } }
}

The xpass here looks exact what we want,After vectorization, it's optimized to
  // MEM <vector(4) char> [(char *)&a2] = { 0, 1, 2, 3 };
  // MEM <vector(4) char> [(char *)&a3] = { 0, 1, 2, 3 };
  // MEM <vector(8) char> [(char *)&a4] = { 0, 1, 2, 3, 4, 5, 6, 7 };
  // MEM <vector(8) char> [(char *)&a7] = { 0, 1, 2, 3, 4, 5, 6, 7 };
  // MEM <vector(16) char> [(char *)&a15] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15 };
and Wstring-overflow catchs these.

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

end of thread, other threads:[~2021-12-16 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13  2:49 [Bug middle-end/102722] New: [Disgnostic]Xpass for gcc.dg/Wstringop-overflow-68.c after O2 vectorization crazylht at gmail dot com
2021-10-20  2:13 ` [Bug middle-end/102722] " cvs-commit at gcc dot gnu.org
2021-12-16 18:28 ` msebor 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).