[PATCH] Fix PR27529, a step towards fixing PR27039
Mark Mitchell
mark@codesourcery.com
Fri Sep 1 21:19:00 GMT 2006
Andrew Haley wrote:
> Ian Lance Taylor writes:
>
> > Can you give more details about when Java needs to generate code
> > for pointer conversions?
>
> Whenever we can't prove by static analysis that the conversion is type
> safe.
To be clear, C++ generates code for pointer-conversions too, for
derived-to-base casts involving multiple inheritance. This is simpler
than Java, which has to do something more likely dynamic_cast, which is
explicitly a function call in C++.
I agree that we should not have language-dependent interpretation in the
middle end, and that the right thing is for the Java front end to
generate explicit code, whether it's the actual code to do the
conversion or a new tree node that explicitly indicates the conversion,
or whether it's just that we retreat from the position that CONVERT_EXPR
is a synonym for NOP_EXPR.
However, I also think that it's OK to have a language-dependent hack in
the middle-end in 4.2 to deal with this Java bug, so I'm comfortable
with Ian's approval of the patch for that branch.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list