https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121762
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:6eff00d2fc3b709d27f7c3727168e1f8336246a5 commit r16-4203-g6eff00d2fc3b709d27f7c3727168e1f8336246a5 Author: Andrew Pinski <[email protected]> Date: Tue Sep 23 12:58:37 2025 -0700 fab/gimple-fold/forwprop: Move va_args folding to gimple_fold [PR121762] This moves the va_args functions folding to gimple-fold. Right now this is still kept for the last folding but later it can move sometime after stdargs pass is run by checking PROP_gimple_lva instead. Also for forwprop, if a folding happens for the last folding we need to maybe update the variables as non-addressable like what is done in fab. It was originally added in fab for __builtin_sincos->__builtin_cexpi folding (PR39643). After the removal of fab, this will also be the last pass which updates address taken too. PR tree-optimization/121762 gcc/ChangeLog: * gimple-fold.cc (gimple_fold_builtin_stdarg): New function, moved from tree-ssa-ccp.cc (optimize_stdarg_builtin). (gimple_fold_builtin): Call gimple_fold_builtin_stdarg for va_start, va_copy and va_end. * tree-ssa-ccp.cc (optimize_stdarg_builtin): Remove. (pass_fold_builtins::execute): Remove handling of va_start, va_copy and va_end. * tree-ssa-forwprop.cc (pass_forwprop::execute): Update todos if fold_stmt return true if last forwprop to include TODO_update_address_taken. Signed-off-by: Andrew Pinski <[email protected]>
