[Bug c++/102454] ICE in gimplify_var_or_parm_decl, at gimplify.c:2958

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 28 18:54:16 GMT 2021


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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

https://gcc.gnu.org/g:fae627162d5f8cfb273b10349883eeb74baaa43f

commit r12-3932-gfae627162d5f8cfb273b10349883eeb74baaa43f
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Mon Sep 27 20:21:40 2021 +0100

    coroutines: Only set parm copy guard vars if we have exceptions [PR
102454].

    For coroutines, we make copies of the original function arguments into
    the coroutine frame.  Normally, these are destroyed on the proper exit
    from the coroutine when the frame is destroyed.

    However, if an exception is thrown before the first suspend point is
    reached, the cleanup has to happen in the ramp function.  These cleanups
    are guarded such that they are only applied to any param copies actually
    made.

    The ICE is caused by an attempt to set the guard variable when there are
    no exceptions enabled (the guard var is not created in this case).

    Fixed by checking for flag_exceptions in this case too.

    While touching this code paths, also clean up the synthetic names used
    when a function parm is unnamed.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

            PR c++/102454

    gcc/cp/ChangeLog:

            * coroutines.cc (analyze_fn_parms): Clean up synthetic names for
            unnamed function params.
            (morph_fn_to_coro): Do not try to set a guard variable for param
            DTORs in the ramp, unless we have exceptions active.

    gcc/testsuite/ChangeLog:

            * g++.dg/coroutines/pr102454.C: New test.


More information about the Gcc-bugs mailing list