public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "652023330028 at smail dot nju.edu.cn" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112994] New: [Regression] Missed optimization for redundancy computation elimination because pattern is broken Date: Wed, 13 Dec 2023 05:46:45 +0000 [thread overview] Message-ID: <bug-112994-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112994 Bug ID: 112994 Summary: [Regression] Missed optimization for redundancy computation elimination because pattern is broken Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: 652023330028 at smail dot nju.edu.cn Target Milestone: --- Hello, we noticed that maybe there is a missed optimization for redundancy computation elimination. Different from PR 111718, this missed optimization is a regression and not just because of one missing pattern, but because of changes that broke patterns that could have been eliminated: The pattern /* Simplify (t * 2) / t) -> 2. */ is broken. https://godbolt.org/z/3er613Krx int n,m; void test(int a, int b){ n=a+a; b=n; m=(n+b)/(b); } GCC (trunk) -O3: test(int, int): lea eax, [0+rdi*4] lea ecx, [rdi+rdi] cdq mov DWORD PTR n[rip], ecx idiv ecx mov DWORD PTR m[rip], eax ret Expected code (GCC 11.4 -O3): test(int, int): mov DWORD PTR m[rip], 2 add edi, edi mov DWORD PTR n[rip], edi ret If our targeting is accurate, then this issue was caused by this commit: https://github.com/gcc-mirror/gcc/commit/d846f225c25 Thank you very much for your time and effort! We look forward to hearing from you.
next reply other threads:[~2023-12-13 5:46 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-12-13 5:46 652023330028 at smail dot nju.edu.cn [this message] 2023-12-13 6:15 ` [Bug tree-optimization/112994] " pinskia at gcc dot gnu.org 2023-12-13 8:24 ` [Bug tree-optimization/112994] [12/13/14 Regression] " rguenth at gcc dot gnu.org 2023-12-13 14:26 ` jakub at gcc dot gnu.org 2023-12-13 15:13 ` jakub at gcc dot gnu.org 2023-12-13 16:02 ` jakub at gcc dot gnu.org 2023-12-13 18:15 ` jakub at gcc dot gnu.org 2023-12-13 18:16 ` jakub at gcc dot gnu.org 2023-12-14 10:58 ` cvs-commit at gcc dot gnu.org 2023-12-14 11:07 ` cvs-commit at gcc dot gnu.org 2023-12-15 12:40 ` jakub 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-112994-4@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).