On Mon, Jan 05, 2026 at 11:24:47AM +0100, Richard Biener wrote:
> > diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
> > index 0c519cf4c21..e931a227afd 100644
> > --- a/gcc/tree-ssa-sccvn.cc
> > +++ b/gcc/tree-ssa-sccvn.cc
> > @@ -2315,7 +2315,17 @@ vn_walk_cb_data::push_partial_def (pd_data pd,
> > /* Make sure to interpret in a type that has a range covering the whole
> > access size. */
> > if (INTEGRAL_TYPE_P (vr->type) && maxsizei != TYPE_PRECISION (vr->type))
> > - type = build_nonstandard_integer_type (maxsizei, TYPE_UNSIGNED (type));
> > + {
> > + if (TREE_CODE (vr->type) == BITINT_TYPE
> > + && maxsizei > MAX_FIXED_MODE_SIZE)
>
> Hmm. I'd like to catch this earlier. We have
>
> void *
> vn_walk_cb_data::push_partial_def (pd_data pd,
> alias_set_type set, alias_set_type
> base_set,
> HOST_WIDE_INT offseti,
> HOST_WIDE_INT maxsizei)
> {
> /* We're using a fixed buffer for encoding so fail early if the object
> we want to interpret is bigger. */
> if (maxsizei > bufsize * BITS_PER_UNIT
> || CHAR_BIT != 8
> || BITS_PER_UNIT != 8
> /* Not prepared to handle PDP endian. */
> || BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN)
> return (void *)-1;
>
> so either we disregard integral types with > MAX_FIXED_MODE_SIZE here or
> if there's a compelling reason to handle partial-def BIT_INT_TYPE we should
> instead build a proper bit int type instead of failing with
> non-standard integer type?
>
> Jakub?
I don't see why we need to punt for that.
Just
if (TREE_CODE (vr->type) == BITINT_TYPE && maxsizei > MAX_FIXED_MODE_SIZE)
type = build_bitint_type (maxsizei, TYPE_UNSIGNED (type));
else
type = build_nonstandard_integer_type (maxsizei, TYPE_UNSIGNED (type));
? That is roughly what e.g. tree-sra.cc does too.
Jakub