https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125711
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think it's this hunk:
+ /* Handlers can refer to the function result; if that has been
+ moved, we need to track it. */
+ if (gimplify_ctxp->in_handler_expr && gimplify_ctxp->return_temp)
+ *expr_p = gimplify_ctxp->return_temp;
which rewrites *expr_p from a RESULT_DECL into a VAR_DECL. Then in
gimplify_return_expr we don't take the
if (!ret_expr
|| TREE_CODE (ret_expr) == RESULT_DECL)
path.