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 Fri, 2004-05-28 at 11:32, Roger Sayle wrote:
> 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).
> 
> I was thinking about something like:
Well, you have to be really really careful with pointer types,
particularly pointers to functions, void * and char *.  But it
is also important to recognize that a pointer to X is the same as
a reference to an X.

I also suspect it's important that we allow languages to specify that
two types are compatible.  It may in fact be important that we allow
the languages to explicitly state that two types that appear
compatible are in fact not compatible for some reason. Basically I'm
not comfortable with type equivalence/compatibility being language
neutral for trees.  

Another note, I found it quite valuable to first walk down the pointer
types ignoring TYPE_MAIN_VARIANT until we got to something that was
not a pointer.




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