[PATCH] Complete useless_type_conversion_p_1 some more (need Ada help)
Richard Guenther
rguenther@suse.de
Tue Aug 4 12:00:00 GMT 2009
On Tue, 4 Aug 2009, Jakub Jelinek wrote:
> On Tue, Aug 04, 2009 at 01:46:20PM +0200, Richard Guenther wrote:
> >
> > This completes useless_type_conversion_p_1 some more by making the
> > comparison for function and array types be independent of frontends.
> >
> > During the array work I came along some oddities wrt the Ada frontend
> > and the stuff that is left in the types. For example if you remove
> > the hack
> >
> > + /* ??? Ada does weird things with type sizes and defers
> > gimplifying
> > + them. To not ICE during expansion for for example cdd2a01 we
> > + avoid stripping conversions from types whose size contains
> > + placeholder exprs. */
> > + if (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (inner_type)))
> > + return false;
>
> Couldn't we have a global variable which says if there are any
> types containing placeholders (i.e. whether any PLACEHOLDER_EXPRs have been
> created)? That would make this cheaper for all the languages that don't have
> them (all but Ada) and could be used even for LTO FE.
If this (and similar places) turn out to be expensive we probably could
spare a (or two) bit(s) in the type tree to cache this?
I'm experimenting with checking TYPE_SIZE for being constant instead now.
Richard.
More information about the Gcc-patches
mailing list