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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-10-22
                 CC|                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think we should not preserve side-effects of gcc_assert, the
define with __builtin_unreachable is "broken" in that way, I'm not
sure why we decided to introduce that variant?

gcc_assert should be consistent with gcc_checking_assert and the latter
uses

#if CHECKING_P
#define gcc_checking_assert(EXPR) gcc_assert (EXPR)
#else
/* N.B.: in release build EXPR is not evaluated.  */
#define gcc_checking_assert(EXPR) ((void)(0 && (EXPR)))
#endif

The original desired behavior (not evaluate side-effects) is consistent
with assert(3).

Reply via email to