On Fri, Jul 25, 2025 at 10:53:35AM +0800, Yang Yujie wrote: > For targets that set the "extended" flag in TARGET_C_BITINT_TYPE_INFO, > we assume small _BitInts to be internally extended after arithmetic > operations. In this case, an extra extension during RTL expansion > can be avoided. > > gcc/ChangeLog: > > * expr.cc (expand_expr_real_1): Do not call > reduce_to_bit_field_precision if the target assume the _BitInt
s/assume/assumes/ > results to be already extended. > (EXTEND_BITINT): Same. > * expr.h (bitint_extended): Declare the cache variable. > * function.cc (prepare_function_start): Initialize it. > --- a/gcc/expr.cc > +++ b/gcc/expr.cc > @@ -76,6 +76,10 @@ along with GCC; see the file COPYING3. If not see > the same indirect address eventually. */ > int cse_not_expected; > > +/* Cache of the "extended" flag in the target's _BitInt description > + for use during expand. */ > +int bitint_extended; I'd also initialize this to -1 statically just in case. Ok for trunk with those 2 nits changed. Jakub