Hello world, this implements SUM and PRODUCT for UNSIGNED. This is actually missing from 24-116.txt, but that is due to an oversight. This patch is on top of
https://gcc.gnu.org/pipermail/fortran/2024-September/060975.html and uses the same method suggested by Richard: Use unsigned for the data in SUM and PRODUCT in the integer library version, and call the integer library version for unsigned. Regression-tested. OK for trunk? Best regards Thomas gcc/fortran/ChangeLog: * gfortran.texi: Document SUM and PRODUCT. * iresolve.cc (resolve_transformational): New argument, use_integer, to translate calls to unsigned to calls to integer. (gfc_resolve_product): Use it (gfc_resolve_sum): Use it. * simplify.cc (init_result_expr): Handle BT_UNSIGNED. libgfortran/ChangeLog: * generated/product_c10.c: Regenerated. * generated/product_c16.c: Regenerated. * generated/product_c17.c: Regenerated. * generated/product_c4.c: Regenerated. * generated/product_c8.c: Regenerated. * generated/product_i1.c: Regenerated. * generated/product_i16.c: Regenerated. * generated/product_i2.c: Regenerated. * generated/product_i4.c: Regenerated. * generated/product_i8.c: Regenarated. * generated/product_r10.c: Regenerated. * generated/product_r16.c: Regenerated. * generated/product_r17.c: Regenerated. * generated/product_r4.c: Regenerated. * generated/product_r8.c: Regenarated. * generated/sum_c10.c: Regenerated. * generated/sum_c16.c: Regenerated. * generated/sum_c17.c: Regenerated. * generated/sum_c4.c: Regenerated. * generated/sum_c8.c: Regenerated. * generated/sum_i1.c: Regenerated. * generated/sum_i16.c: Regenerated. * generated/sum_i2.c: Regenerated. * generated/sum_i4.c: Regenerated. * generated/sum_i8.c: Regenerated. * generated/sum_r10.c: Regenerated. * generated/sum_r16.c: Regenerated. * generated/sum_r17.c: Regenerated. * generated/sum_r4.c: Regenerated. * generated/sum_r8.c: Regenerated. * m4/ifunction.m4: Whitespace fix. * m4/product.m4: If type is integer, change to unsigned. * m4/sum.m4: Likewise.