https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119792

--- Comment #17 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 21 Apr 2025, ebotcazou at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119792
> 
> --- Comment #16 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> > Eric, can you try to read through 
> > https://gcc.gnu.org/wiki/document-middle-end-type-system and amend
> > it with comments about Ada?
> 
> I added a minimal comment about TYPE_CANONICAL a couple of days ago.
> 
> > I'm especially curious what exactly the properties are that are not useless
> > in the VIEW_CONVERT_EXPRs that get wrongly stripped here?
> 
> The VIEW_CONVERT_EXPR gives the (fixed) size of the RHS of an assignment, the
> RHS being the dereference of a pointer to a self-referential type
> (type_contains_placeholder_p).

So WITH_SIZE_EXPR isn't applicable here?  OK, that's a thing
only introduced by gimplification at the moment, IIRC.  So in case
the VIEW_CONVERT_EXPR is "just" to make the gimplifier emit the
appropriate WITH_SIZE_EXPR I wonder whether we should change
GENERIC to make that the prefered communication vehicle?

Note TREE_TYPE of the WITH_SIZE_EXPR should agree with the
TREE_TYPE of its operand 0.

The other option would be to make sure to not apply the GIMPLE
useless_type_conversion_p to GENERIC before creating the
WITH_SIZE_EXPR (which would be a fix anyway, IMO).

In case it's really just about WITH_SIZE_EXPR ...

Reply via email to