public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/94392] New: Infinite loops are optimized away for C99
@ 2020-03-29 21:13 krister.walfridsson at gmail dot com
  2020-03-29 21:22 ` [Bug c/94392] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: krister.walfridsson at gmail dot com @ 2020-03-29 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94392
           Summary: Infinite loops are optimized away for C99
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: krister.walfridsson at gmail dot com
  Target Milestone: ---

Created attachment 48141
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48141&action=edit
Source code reproducing the issue

John Regehr noticed on twitter
(https://twitter.com/johnregehr/status/1244335355509129216) that trunk GCC
removes infinite loops for C99, as can be seen by
  gcc -O3 -std=c99 fermat.c

This behavior was introduced by the introduction of -ffinite-loops being
enabled at -O2. This is fine for C11, but infinite loops do not invoke
undefined behavior in C99, so the optimization should not be enabled per
default for -std=c99.

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

end of thread, other threads:[~2020-04-03  8:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-29 21:13 [Bug c/94392] New: Infinite loops are optimized away for C99 krister.walfridsson at gmail dot com
2020-03-29 21:22 ` [Bug c/94392] " pinskia at gcc dot gnu.org
2020-03-30  8:21 ` [Bug c/94392] [10 Regression] " rguenth at gcc dot gnu.org
2020-03-30 23:36 ` joseph at codesourcery dot com
2020-03-31  6:34 ` rguenther at suse dot de
2020-04-01  7:44 ` rguenth at gcc dot gnu.org
2020-04-02 14:53 ` cvs-commit at gcc dot gnu.org
2020-04-02 14:54 ` rguenth at gcc dot gnu.org
2020-04-03  8:10 ` cvs-commit 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).