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

--- Comment #12 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #11)
> More reduced test case, that does not depend on -ipa-icf:
> 
> struct R
> {
>   R (const R&) { }
> };
> 
> __attribute__ ((noreturn)) R f ();
> 
> R
> c ()
> {
>   f ();
> }
> 
> Untested fix:
> 
> diff --git a/gcc/gimplify.c b/gcc/gimplify.c
> index ce1e712..e07cd04 100644
> --- a/gcc/gimplify.c
> +++ b/gcc/gimplify.c
> @@ -4830,7 +4830,8 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p,
> gimple_seq *post_p,
>             }
>         }
>        notice_special_calls (call_stmt);
> -      if (!gimple_call_noreturn_p (call_stmt))
> +      if (!gimple_call_noreturn_p (call_stmt)
> +         || gimple_call_return_slot_opt_p (call_stmt))
>         gimple_call_set_lhs (call_stmt, *to_p);
>        assign = call_stmt;
>      }

Actually in light of #c2 this might be a separate but related issue.

Reply via email to