This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/69241] [6 Regression] ICE with noreturn and function that return non-POD
- From: "ppalka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 02 Feb 2016 22:23:24 +0000
- Subject: [Bug ipa/69241] [6 Regression] ICE with noreturn and function that return non-POD
- Auto-submitted: auto-generated
- References: <bug-69241-4 at http dot gcc dot gnu dot org/bugzilla/>
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.