This is the mail archive of the gcc@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: Canonical type nodes, or, comptypes considered harmful


Ian Lance Taylor wrote:

> This assumes, of course, that we can build an equivalence set for
> types.  I think that we need to make that work in the middle-end, and
> force the front-ends to conform.  As someone else mentioned, there are
> horrific cases in C like a[] being compatible with both a[5] and a[10]
> but a[5] and a[10] not being compatible with each other, and similarly
> f() is compatible with f(int) and f(float) but the latter two are not
> compatible with each other. 

I don't think these cases are serious problems; they're compatible
types, not equivalent types.  You don't need to check compatibility as
often as equivalence.  Certainly, in the big C++ test cases, Mike is
right that templates are the killer, and they're you're generally
testing equivalence.

So, if you separate same_type_p from compatible_type_p, and make
same_type_p fast, then that's still a big win.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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