https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127345
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- If it is a VCE from bool to unsigned char (same size, precision 1 for bool, precision 8 for unsigned char), then it the treatment of r16-4708 is ok, because bool is special and the only valid values in the 8 bits are 0 or 1, anything else is UB. As Jeff wrote in PR91191, if it is a VCE from integral to integral type and TYPE_PRECISION (outer) <= TYPE_PRECISION (inner), then it also works as normal cast. Yet another case is for _BitInt on targets where info.extended == bitint_ext_full, the bits also should be extended (though am not sure if it is safe to rely on it everywhere, rather than just within memory where it is observable (only in that case the compiler has to make sure it is extended because it is an ABI observable thing)). On this testcase, it is none of that, the upper bits are undefined, so it acts like paradoxical subreg in RTL. The only thing the ranger could reliably do there is preserve the mask for the lower bits (which bits in there are zero and which are non-zero and which are unknown) and say the upper bits are unknown too.
