This is the mail archive of the 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: [PATCH] Fix PR27529, a step towards fixing PR27039

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

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
(650) 331-3385 x713

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