https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119717
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Qing Zhao <qinz...@gcc.gnu.org>: https://gcc.gnu.org/g:727f330f9ac661339af1121fc5c9b67dd0d35872 commit r15-9505-g727f330f9ac661339af1121fc5c9b67dd0d35872 Author: Qing Zhao <qing.z...@oracle.com> Date: Mon Apr 14 19:41:12 2025 +0000 c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717] C_MAYBE_CONST_EXPR is a C FE operator that will be removed by c_fully_fold. In c_fully_fold, it assumes that operands of function calls have already been folded. However, when we build call to .ACCESS_WITH_SIZE, all its operands are not fully folded. therefore the C FE specific operator is passed to middle-end. In order to fix this issue, fully fold the parameters before building the call to .ACCESS_WITH_SIZE. PR c/119717 gcc/c/ChangeLog: * c-typeck.cc (build_access_with_size_for_counted_by): Fully fold the parameters for call to .ACCESS_WITH_SIZE. gcc/testsuite/ChangeLog: * gcc.dg/pr119717.c: New test.