This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] improve C++ code by changing fold-const.c
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, Richard Henderson <rth at redhat dot com>, <gcc-patches at gcc dot gnu dot org>, Mark Mitchell <mark at codesourcery dot com>, <law at redhat dot com>
- Date: Fri, 28 May 2004 13:41:32 -0400
- Subject: Re: [PATCH] improve C++ code by changing fold-const.c
- References: <Pine.LNX.firstname.lastname@example.org>
On May 28, 2004, at 13:32, Roger Sayle wrote:
On Thu, 27 May 2004, Richard Henderson wrote:
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!
The miscommunication appears to be that you believe that pointer
equality should be sufficient for ANY front-end. My argument is
that this shouldn't be a language hook, because Java, fortran,
pascal, treelang and GCC's other front-end would benefit from a
generic middle-end "types_compatible_p". In fact, there's very little
language specific about the C types_compatible_lang hook, other than it
only discards qualifications at the outer level (probably a bug).
But what you gave will not work as in C structs are compatible across
translational units which is why the language hook came in existence in
first place. Now making your types_compatible_p into the default
hook would most likely be the right thing but I do not know.