This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] A GIMPLE and "GIMPLE type system" verifier
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: iant at google dot com
- Cc: dnovillo at google dot com, gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Fri, 01 Jun 2007 11:23:11 EDT
- Subject: Re: [PATCH][RFC] A GIMPLE and "GIMPLE type system" verifier
- References: <Pine.LNX.4.64.0705311605010.27490@zhemvz.fhfr.qr> <465EEA47.2010700@google.com> <Pine.LNX.4.64.0706011354590.27490@zhemvz.fhfr.qr> <m3myzjpw83.fsf@localhost.localdomain>
> 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 ...