This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Fix PR tree-optimization/21407
Mike Stump wrote:
On May 10, 2005, at 8:51 PM, Daniel Berlin wrote:
However, since I can't see it as in any way useful
I'd like to think google ("upcast") or google ("up-cast") could
convince you...
Generally frowned upon, but handy some of the time. Maybe C needs an
up_cast() operator? :-) Given that, and requiring it, would allow
the optimizer to do what it does best, almost all the time, and the 2
lines per million that need up_cast, could use it.
I would also point out that an upcast operator is of no help at all.
The problem is not looking at an address expression and discovering if
it is an upcast. The problem is having a pointer in one compilation
unit and understanding what can be done with that pointer in a different
compilation unit that you cannot see the code in.
Also, it would seem to me that Ada and Java probably have upcast, and
that the back end has to work for them too... I just don't know if
they would trip over it.
In java the existence of the heirarchy says you can upcast here, but you
are not allowed to move around from a field to it's brother in a structure.
kenny