This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DCE enhancement to delete dead vptr assignment


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]