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 c++/114421] arm-none-eabi thumb -Os (and -O2) incorrectly optimizes out needed class member call
Date: Thu, 21 Mar 2024 21:46:56 +0000	[thread overview]
Message-ID: <bug-114421-4-MKP6cqhlxp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114421-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://en.cppreference.com/w/cpp/language/memory_model#Forward_progress is a
decent reference when it comes to what it means by forward progress in C++.
Note C and C++ have slightly different requirements. And C++17 has different
from previous versions of C++ also.




(In reply to Xi Ruoyao from comment #3)
> In C++ there is no "the controlling expression is a constant expression"
> exempt, so even while (true); can be optimized out.  AFAIK GCC does not
> optimize away while (true); in C++, but Clang is actively doing this.  There
> is a WG21 paper to add the constant expression exemption for C++ like C (I
> cannot remember its Nxxxx ID though).

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2809r0.html is the
paper about C++'s `while(true);`

  parent reply	other threads:[~2024-03-21 21:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 19:37 [Bug c++/114421] New: " earlephilhower at yahoo dot com
2024-03-21 19:43 ` [Bug c++/114421] " pinskia at gcc dot gnu.org
2024-03-21 19:53 ` earlephilhower at yahoo dot com
2024-03-21 20:01 ` xry111 at gcc dot gnu.org
2024-03-21 21:40 ` pinskia at gcc dot gnu.org
2024-03-21 21:46 ` pinskia at gcc dot gnu.org [this message]
2024-03-21 21:47 ` pinskia at gcc dot gnu.org
2024-03-21 21:48 ` pinskia 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-114421-4-MKP6cqhlxp@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: link
Be 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).