public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug d/101691] New: d: Use of LOOP_EXPR prevents removing no-op loops. @ 2021-07-30 10:35 ibuclaw at gdcproject dot org 2021-07-30 20:47 ` [Bug d/101691] " pinskia at gcc dot gnu.org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: ibuclaw at gdcproject dot org @ 2021-07-30 10:35 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101691 Bug ID: 101691 Summary: d: Use of LOOP_EXPR prevents removing no-op loops. Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: d Assignee: ibuclaw at gdcproject dot org Reporter: ibuclaw at gdcproject dot org Target Milestone: --- As observed on compiler explorer. https://d.godbolt.org/z/eM8Pv91eT The C, C++ (and Fortran?) front-ends lower loops as labels and gotos, which *is* optimized away. https://godbolt.org/z/8Yz9oqx63 --- void fun(int a, int b, int step) { for (int i = a; i < b; i += step) { } } ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug d/101691] d: Use of LOOP_EXPR prevents removing no-op loops. 2021-07-30 10:35 [Bug d/101691] New: d: Use of LOOP_EXPR prevents removing no-op loops ibuclaw at gdcproject dot org @ 2021-07-30 20:47 ` pinskia at gcc dot gnu.org 2021-07-30 20:49 ` pinskia at gcc dot gnu.org 2022-07-08 8:54 ` ibuclaw at gdcproject dot org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2021-07-30 20:47 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101691 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- cannot prove finiteness of loop 1 Note the C code you posted is not the same as the D code. Using int is able to optimize away for C++ code but not for C code. The reason why it is able to optimize away for C++ code is because -ffinite-loops is turned on there. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug d/101691] d: Use of LOOP_EXPR prevents removing no-op loops. 2021-07-30 10:35 [Bug d/101691] New: d: Use of LOOP_EXPR prevents removing no-op loops ibuclaw at gdcproject dot org 2021-07-30 20:47 ` [Bug d/101691] " pinskia at gcc dot gnu.org @ 2021-07-30 20:49 ` pinskia at gcc dot gnu.org 2022-07-08 8:54 ` ibuclaw at gdcproject dot org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2021-07-30 20:49 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101691 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- LOOP_EXPR has nothing to do with this problem really. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug d/101691] d: Use of LOOP_EXPR prevents removing no-op loops. 2021-07-30 10:35 [Bug d/101691] New: d: Use of LOOP_EXPR prevents removing no-op loops ibuclaw at gdcproject dot org 2021-07-30 20:47 ` [Bug d/101691] " pinskia at gcc dot gnu.org 2021-07-30 20:49 ` pinskia at gcc dot gnu.org @ 2022-07-08 8:54 ` ibuclaw at gdcproject dot org 2 siblings, 0 replies; 4+ messages in thread From: ibuclaw at gdcproject dot org @ 2022-07-08 8:54 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101691 Iain Buclaw <ibuclaw at gdcproject dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #3 from Iain Buclaw <ibuclaw at gdcproject dot org> --- Confirmed it is finite loops that makes the difference, nothing to do here. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-08 8:54 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-07-30 10:35 [Bug d/101691] New: d: Use of LOOP_EXPR prevents removing no-op loops ibuclaw at gdcproject dot org 2021-07-30 20:47 ` [Bug d/101691] " pinskia at gcc dot gnu.org 2021-07-30 20:49 ` pinskia at gcc dot gnu.org 2022-07-08 8:54 ` ibuclaw at gdcproject dot 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).