public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "tnfchris at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102893] New: [8/9/10/11/12 Regression] CDDCE does not detect empty infinite nested loops Date: Fri, 22 Oct 2021 09:40:37 +0000 [thread overview] Message-ID: <bug-102893-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102893 Bug ID: 102893 Summary: [8/9/10/11/12 Regression] CDDCE does not detect empty infinite nested loops Product: gcc Version: 8.5.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: tnfchris at gcc dot gnu.org Target Milestone: --- The following example int main() { while(1) { for(int i=0; i<9000000; i++){} } } In GCC 7 compiled to main: .L2: b .L2 but since GCC 8 compiles to main: .L3: mov w0, 21568 movk w0, 0x89, lsl 16 .L2: subs w0, w0, #1 bne .L2 b .L3 The difference seems to be in cddce which previously was able to detect the code as dead: ;; 3 loops found ;; ;; Loop 0 ;; header 0, latch 1 ;; depth 0, outer -1 ;; nodes: 0 1 2 3 4 5 6 ;; ;; Loop 1 ;; header 3, latch 6 ;; depth 1, outer 0 ;; nodes: 3 6 5 4 ;; ;; Loop 2 ;; header 5, latch 4 ;; depth 2, outer 1 ;; nodes: 5 4 ;; 2 succs { 3 } ;; 3 succs { 5 } ;; 4 succs { 5 } ;; 5 succs { 4 6 } ;; 6 succs { 3 } can not prove finiteness of loop 1 Removing basic block 4 Merging blocks 3 and 5 Removing basic block 6 but since GCC 8 does ;; 3 loops found ;; ;; Loop 0 ;; header 0, latch 1 ;; depth 0, outer -1 ;; nodes: 0 1 2 3 4 5 6 ;; ;; Loop 1 ;; header 3, latch 6 ;; depth 1, outer 0 ;; nodes: 3 6 5 4 ;; ;; Loop 2 ;; header 5, latch 4 ;; depth 2, outer 1 ;; nodes: 5 4 ;; 2 succs { 3 } ;; 3 succs { 5 } ;; 4 succs { 5 } ;; 5 succs { 4 6 } ;; 6 succs { 3 } cannot prove finiteness of loop 1
next reply other threads:[~2021-10-22 9:40 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-22 9:40 tnfchris at gcc dot gnu.org [this message] 2021-10-22 10:44 ` [Bug tree-optimization/102893] [9/10/11/12 " rguenth at gcc dot gnu.org 2021-10-22 11:43 ` cvs-commit at gcc dot gnu.org 2021-10-22 11:43 ` [Bug tree-optimization/102893] [9/10/11 " rguenth at gcc dot gnu.org 2021-10-22 12:07 ` tnfchris at gcc dot gnu.org 2022-02-17 10:17 ` rguenth at gcc dot gnu.org 2022-02-17 11:26 ` cvs-commit at gcc dot gnu.org 2022-05-27 9:46 ` [Bug tree-optimization/102893] [10 " rguenth at gcc dot gnu.org 2022-06-28 10:46 ` jakub at gcc dot gnu.org 2023-07-07 9:47 ` 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-102893-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).