public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102139] [11/12 Regression] -O3 miscompile due to slp-vectorize on strict align target Date: Tue, 31 Aug 2021 01:24:25 +0000 [thread overview] Message-ID: <bug-102139-4-WvjNebJXtx@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102139-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102139 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Target Milestone|--- |11.3 Ever confirmed|0 |1 Summary|-O3 miscompile due to |[11/12 Regression] -O3 |slp-vectorize on strict |miscompile due to |align target |slp-vectorize on strict | |align target Last reconfirmed| |2021-08-31 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- fre is fine here. The problem is SLP. Here is why take: typedef decltype(sizeof(0)) size_t; typedef unsigned short uint16_t; typedef unsigned uint32_t; void zero_two_uint16(uint16_t* ptr) { ptr[0] = 0; ptr[1] = 0; } #define vector __attribute__((vector_size(sizeof(uint16_t)*4))) void f(uint16_t *a) { vector uint16_t *b = (vector uint16_t *)a; *b = (vector uint16_t){}; } void g(uint16_t *a) { size_t t = (size_t)a; if ((t & 0x7)==0) { for(int i = 0;i < 8;i++) f((a + i*4)); } else { for(int i = 0;i < 16;i++) zero_two_uint16((a + i*2)); } } ---- CUT ---- Compile it on aarch64 with -O3 -mgeneral-regs-only -fno-tree-loop-distribute-patterns -mstrict-align -fno-tree-loop-vectorize and you will produce the same result for SLP. There is no PHI for a for FRE to merge even. And there is no alignment information on the pointers assignments either. As you can see by the dump (-fdump-tree-*-all): # PT = nonlocal null uint16_tD.1724 * a_15(D) = aD.1733;
next prev parent reply other threads:[~2021-08-31 1:24 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-31 0:15 [Bug tree-optimization/102139] New: " wilson at gcc dot gnu.org 2021-08-31 0:35 ` [Bug tree-optimization/102139] " pinskia at gcc dot gnu.org 2021-08-31 0:38 ` pinskia at gcc dot gnu.org 2021-08-31 1:24 ` pinskia at gcc dot gnu.org [this message] 2021-08-31 1:35 ` [Bug tree-optimization/102139] [11/12 Regression] " pinskia at gcc dot gnu.org 2021-08-31 1:47 ` pinskia at gcc dot gnu.org 2021-08-31 7:38 ` rguenth at gcc dot gnu.org 2021-08-31 10:18 ` rguenth at gcc dot gnu.org 2021-08-31 10:22 ` rguenth at gcc dot gnu.org 2021-09-01 10:54 ` cvs-commit at gcc dot gnu.org 2021-09-01 10:55 ` [Bug tree-optimization/102139] [11 " rguenth at gcc dot gnu.org 2021-11-08 12:35 ` cvs-commit at gcc dot gnu.org 2021-11-08 12:37 ` 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-102139-4-WvjNebJXtx@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: linkBe 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).