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 <andrew.pinski@oss.qualcomm.com>