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, May 28, 2004 at 11:32:47AM -0600, Roger Sayle wrote:
> The miscommunication appears to be that you believe that pointer
> equality should be sufficient for ANY front-end.

Incorrect.  I never said it would be completely sufficient.

I certainly do believe that we should STRIVE for it, and that
there are currently bugs in the front ends that UNNECESSARILY
breaks pointer equality.

But IMA pretty much precludes pointer equality for C.

> 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".

There is one.  It does pointer comparison.  Given that Java and
Fortran don't have "const", I see little benefit in attempting
to look through const.

And your generic function certainly isn't correct for C++.  At
minimum pointer-to-member isn't handled.

> Hopefully this makes more sense now.

Nope.


r~


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