On Tue, Feb 21, 2023 at 08:30:50AM +0100, Richard Biener wrote:
> > I think this mostly helps with access inside the FE of the type 'size =
> > TYPE_SIZE_UNIT(type)', which is used surprisingly often and is often
> > directly evaluated (i.e. assigned to a temporary).
> 
> that's what I thought

So, either we can do a temporary hack where we stick the non-SAVE_EXPR
in there but somehow mark those types in type_lang_specific (if they
aren't yet) and clear that when passing the type from FE to the middle-end.

Or, stick some bogus value into TYPE_SIZE_UNIT (error_mark_node or something
worse that triggers ICEs all around, say VOID_CST) and fix up what breaks,
say add a short function which will replace TYPE_SIZE_UNIT (type) and
do if (TYPE_LANG_SPECIFIC (type) && deferred_len (type)) return
some_type_lang_specific_field (type); else return TYPE_SIZE_UNIT (type)
and replace those.  Or mass replace TYPE_SIZE_UNIT (type) in the FE with
the new function.  Though, there surely are spots for which deferred-len
types may never appear...

        Jakub

Reply via email to