This is the mail archive of the gcc-patches@gcc.gnu.org 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 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 the
first place. Now making your types_compatible_p into the default language
hook would most likely be the right thing but I do not know.


Thanks,
Andrew Pinski


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