This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix devirt from dropping lhs with TREE_ADDRESSABLE type on noreturn calls (PR c++/71210)
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, Jan Hubicka <jh at suse dot cz>, Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 May 2016 14:01:43 +0200 (CEST)
- Subject: Re: [PATCH] Fix devirt from dropping lhs with TREE_ADDRESSABLE type on noreturn calls (PR c++/71210)
- Authentication-results: sourceware.org; auth=none
- References: <20160520113122 dot GI28550 at tucnak dot redhat dot com> <20160520114001 dot GL1611 at redhat dot com> <20160520115948 dot GL28550 at tucnak dot redhat dot com>
On Fri, 20 May 2016, Jakub Jelinek wrote:
> On Fri, May 20, 2016 at 01:40:01PM +0200, Marek Polacek wrote:
> > > + if (lhs
> > > + && (gimple_call_flags (stmt) & ECF_NORETURN)
> > > + && (VOID_TYPE_P (TREE_TYPE (gimple_call_fntype (stmt)))
> > > + || ((TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs)))
> > > + == INTEGER_CST)
> > > + && !TREE_ADDRESSABLE (TREE_TYPE (lhs)))))
> >
> > Do you think it would be worth it to factor out this check into a new
> > predicate and use it throughout the codebase?
>
> I think it would be worthwhile. Are you willing to write a patch for this?
> Otherwise I can add it to my todo list, but it will take a while.
Maybe even make it a maybe_drop_lhs_from_noreturn_call () helper.
Richard.