On Tue, Aug 05, 2025 at 06:28:26PM +0800, Yang Yujie wrote:
> > This part is not correct.  For non-generic address space this
> > will be always non-useless conversion.  If you want to do nothing
> > for the bitint_extended && abi_load_p case, I'd write it as
> >   if (!write_p
> >       && !(bitint_extended && abi_load_p)
> >       && !useless_type_conversion_p (atype, m_limb_type))
> 
> I am not familiar with the non-generic address spaces, but I assume it would 
> be
> OK to have a final cast on the result as long as it is not a truncation,
> which cannot be optimized away later.
> 
> Also, this cast seems to serve a purpose if loading from these address
> spaces is not a no-op (not sure about this too).

Actually, TYPE_ADDR_SPACE is only checked in useless_type_conversion_p for
pointers/references (in that case the qual as of what the pointer points
to), not on INTEGER_TYPEs/BITINT_TYPEs.

So guess your patch is ok.

        Jakub

Reply via email to