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] improve C++ code by changing fold-const.c

On May 27, 2004, at 2:32 PM, Richard Henderson wrote:

On Thu, May 27, 2004 at 12:43:26PM -0600, Roger Sayle wrote:
On Thu, May 27, 2004 at 11:33:22AM -0600, Roger Sayle wrote:
But you'll also appreciate that this function should be independent of
the vagaries of the language front-end, and is therefore distinct
from lang_hook's types_compatible_p.

No, I do not appreciate that. I don't even know what you mean by that.
In my mind, types_compatible_p was created exactly in order to isolate
vagaries of the front-end that result in pointer equality not being

Why is types_compatible_p a lang_hook then? The default implementation
in fortran and java is TYPE_MAIN_VARIANT(x) == TYPE_MAIN_VARIANT(y).

Did I not just say? Both C and C++ do not unify all appearances of a single type into a single tree node (and also fail to link them via TYPE_MAIN_VARIANT). Pointer equality IS NOT SUFFICIENT given the current state of these front ends!

Some of the vagaries are in the language definitions, not the front ends.
I don't think pointer equality can be made sufficient given the peculiarities
of the C99 type system. If you really want to know about this, find the thread
"IMA vs tree-ssa" in February and March 2004. There are good examples
by Geoff Keating and Joseph Myers that show why you need this.

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