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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <[email protected]>:

https://gcc.gnu.org/g:0f9904afc60329beb2a97f73fa8239530288d0e6

commit r16-8746-g0f9904afc60329beb2a97f73fa8239530288d0e6
Author: Iain Buclaw <[email protected]>
Date:   Sat Apr 18 18:50:41 2026 +0200

    d: Fix ICE in gimplify_var_or_parm_decl, at gimplify.cc:3308

    The result type of the assert() should always be the same as its
    inferred expression type, which could either be `void' or `noreturn'.

    Also moves the pattern of calling to BUILT_IN_TRAP to its own codegen
    function, as it is repeated quite enough throughout the front-end.

            PR d/124922

    gcc/d/ChangeLog:

            * d-codegen.cc (build_trap_call): New function.
            (build_array_bounds_call): Use it.
            (build_bounds_index_condition): Likewise.
            (build_bounds_slice_condition): Likewise.
            (d_build_call): Likewise.
            * expr.cc (ExprVisitor::visit (HaltExp *)): Likewise.
            (ExprVisitor::visit (AssertExp *)): Likewise.  Return zero instead
of
            void_node when assert contracts are disabled.
            * d-tree.h (build_trap_call): New prototype.

    gcc/testsuite/ChangeLog:

            * gdc.dg/pr124922.d: New test.

Reply via email to