https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108988
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:dbeccab7a1f5dcc1876c854f17816047ba1ef137 commit r13-6441-gdbeccab7a1f5dcc1876c854f17816047ba1ef137 Author: Jakub Jelinek <ja...@redhat.com> Date: Fri Mar 3 11:13:40 2023 +0100 gimple-fold: Fix up fputs -> fwrite folding [PR108988] gimple_fold_builtin_fputs when folding fputs into fwrite emits the third argument (INTEGER_CST) with incorrect type - get_maxval_strlen or c_strlen return ssizetype, while fwrite argument is size_type_node. The following patch fixes that, I've skimmed through the rest of gimple-fold.cc and in all other places get_maxval_strlen/c_strlen result was fold_converted to size_type_node already (or GIMPLE cast stmt has been emitted directly etc.). 2023-03-03 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/108988 * gimple-fold.cc (gimple_fold_builtin_fputs): Fold len to size_type_node before passing it as argument to fwrite. Formatting fixes.