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][RFC] A GIMPLE and "GIMPLE type system" verifier


> At the mini-summit Danny proposed, in essence, that we simply declare
> that GIMPLE type compatibility to be equality of TYPE_MAIN_VARIANT,
> and that the frontends be required to generate type-safe code under
> that metric.  This is not as insane as it sounds as the only languages
> which use a non-trivial definition of the types_compatible_p langhook
> are in fact C and C++.

My feeling would be to go *further* than that.  The front end should indeed
do the above, but the middle-end should be free to consider two types as
equivalent (in other words, to remove a NOP_EXPR between them) if they are
the same for code-generation purposes.  This allows a front end (and
gimplification code, if necessary) to consider two types as distinct for
debugging output purposes, but not complicate the optimizers unneccessarily.

So we'd have a gimple_types_compatible that would check for two types that
were isomorphic from a code generation perspective and would be used as part
of gimplification.  (For example, two records with the same field layouts
would be equivalent.)

I know this is a bit radical ...


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