This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/45791] Missed devirtualization


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45791

--- Comment #14 from Martin Jambor <jamborm at gcc dot gnu.org> 2010-12-15 16:07:31 UTC ---
(In reply to comment #9)
> OK, main() code seems to optimize out that is an imrovement. Is it optimized
> away with your patch pre-IPA too? 

Yes.  Just before IPA, in fact.

> 
> Derived() is also devirtualizable:
> 

It could be done intraprocedurally if, unlike for automatically
allocated decls, we considered all calls as potentially changing the
dynamic type in unknown ways while doing the dynamic type change
detection.  This then however becomes essentially the same thing as
devirtualization based on the constant folding, perhaps only more
complicated.

It could be optimized by IPA-CP if we can confirm that all callers are
automatically allocated (or that we generally have them under
control).  This should be relatively easy, I will have a look at that.
Mainly because we may be able to widen scope of objects under our
control later.


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