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

Aybars Köse <vinas_solamnus1 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vinas_solamnus1 at hotmail dot 
com

--- Comment #2 from Aybars Köse <vinas_solamnus1 at hotmail dot com> ---
The same crash happens with -fno-exceptions instead of -fno-enforce-eh-specs.
use_eh_spec_block also returns false when flag_exceptions is off, so the
noexcept body has no MUST_NOT_THROW_EXPR in either case.

Flags: -std=c++26 -fno-exceptions

Testcase 1:
  void f(int v) noexcept pre(v > 0) {}

  trunk (Compiler Explorer): internal compiler error: in
maybe_apply_function_contracts, at cp/contracts.cc:1370
  16.2.0 (release checking): internal compiler error: Segmentation fault

Testcase 2 (value-returning function):
  int f(int v) noexcept pre(v > 0) { return v; }

  trunk (Compiler Explorer): internal compiler error: Segmentation fault
  16.2.0 (release checking): internal compiler error: in gimplify_return_expr,
at gimplify.cc:1909

Both compile with exceptions enabled, with noexcept(false), or without the
contract. No ICE with -fcontract-evaluation-semantic=ignore.

Reply via email to