This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/45734] [4.6 Regression] Devirtualization results in wrong-code
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Sep 2010 15:46:33 -0000
- Subject: [Bug tree-optimization/45734] [4.6 Regression] Devirtualization results in wrong-code
- References: <bug-45734-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2010-09-20 15:46 -------
Of course it is ;) Before pointer-conversions became useless we didn't
propagate the invariant address into the OBJ_TYPE_REF expression.
We still have useful function-pointer conversions as well, because
dropping them would wreck CALL_EXPRs, too (we need to preserve the
original function type, similar to the alias-type on MEM_REFs).
I suppose we could do the same for OBJ_TYPE_REFs that I plan(ned) for
CALL_EXPRs - store the pointed-to type via a MEM_REF - thus a
dereferenced address.
You'd then have
CALL_EXPR (MEM [fnptr], args ...)
OBJ_TYPE_REF (MEM [fnptr], MEM [objptr], index)
where both TREE_TYPE of the function and the object are kept like the
FE specified them.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45734