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

--- Comment #10 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Segher Boessenkool from comment #9)
> Although, preferably we should not allow assigning one opaque type to another
> opaque type just because they will eventually use the same mode, not without
> warning anyway?  Or is that unavoidable?  Compare assigning a V4SI to a V4SF.
> 

IIUC, you meant the assignment happening for two different opaque types, then
it's a conversion? If so, I think we can check it in rs6000_invalid_conversion,
currently it just simply checks the modes. If we have two different opaque
types mapping to one same mode, we can further check if the things like
TYPE_CANONICAL match.

> I don't know if your patch does this, btw, and it isn't so easy to test, we
> currently have only one type for each of our opaque modes.  Maybe test by
> adding an extra builtin type :-)

This patch doesn't handle that, the main issue here is that some cv-qualified
opaque type can cause ICE in type verification during LTO. IMHO, opaque types
conversion issue looks like a separated issue and it can be handled in target
hook invalid_conversion. But I guess you want a more generic check?  And as you
pointed out, there is no such scenario that two opaque types have the same
mode, not sure if we really want to handle it for now. :-)

Reply via email to