This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: DCE enhancement to delete dead vptr assignment
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Xinliang David Li <davidxl at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Apr 2010 18:29:08 +0200
- Subject: Re: DCE enhancement to delete dead vptr assignment
- References: <o2r522e93241004160909n99b4f75ezbe31b69bd389a580@mail.gmail.com>
On Fri, Apr 16, 2010 at 6:09 PM, Xinliang David Li <davidxl@google.com> wrote:
> This is related to PR34949. It makes use C++ language semantics.
> Currently it handles empty dtors or their inline instances into
> deleting dtors or inline instances into callers followed by delete
> call. ?It will extend automatically to handle other cases (e.g. dtor
> with printf statement etc) when more precise alias/mod-ref or builtin
> function side effect information is available.
>
> bootstrap and regression on x86-64/linux
>
> Ok for mainline?
I don't think this is a step in the right direction, in tree-ssa-dce.c:
+ {
+ /* Initialization of the vptr field for the same object this
+ destructor is operating on won't be live out of the function
+ if it is not used within the function, so do not treat them
+ as a hidden global store. */
+ if (lang_hooks.decls.is_decl_dtor (current_function_decl))
+ {
We should not be calling lang hooks from the optimizers.
How would this work with inter-language IPA?
Ciao!
Steven