https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121762
--- Comment #17 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:e9ba0f896efd1ef4f713923304e95eb3b2490f54 commit r16-4206-ge9ba0f896efd1ef4f713923304e95eb3b2490f54 Author: Andrew Pinski <[email protected]> Date: Tue Sep 23 21:36:00 2025 -0700 Remove fold_builtin pass [PR121762] After moving the last optimization out of fab, we can finally remove this pass. For -Og, we remove this pass and also swaps out the copy_prop for a forwprop (which does an integrated copy prop too). A few testcases needed to be updated. Most is just s/fab1/optimized/ except for pr79691.c which needed a slight change in the scaning of the optimized dump; to find `return 9;` instead of `= 9;`. Bootstrappd and tested on x86_64-linux-gnu. PR tree-optimization/121762 gcc/ChangeLog: * passes.def: Remove both pass_fold_builtin. Swap out pass_copy_prop for pass_forwprop with full_walk = false and last=true. * tree-pass.h (make_pass_fold_builtins): Remove. * tree-ssa-ccp.cc (class pass_fold_builtins): Delete. (pass_fold_builtins::execute): Delete. (make_pass_fold_builtins): Remove. * doc/passes.texi (Folding built-in functions): Remove. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/builtin-fprintf-1.c: Update to scan optimized. * gcc.dg/tree-ssa/builtin-fprintf-chk-1.c: Likewise. * gcc.dg/tree-ssa/builtin-printf-1.c: Likewise. * gcc.dg/tree-ssa/builtin-printf-chk-1.c: Likewise. * gcc.dg/tree-ssa/builtin-vfprintf-1.c: Likewise. * gcc.dg/tree-ssa/builtin-vfprintf-chk-1.c: Likewise. * gcc.dg/tree-ssa/builtin-vprintf-1.c: Likewise. * gcc.dg/tree-ssa/builtin-vprintf-chk-1.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-10.c: Likewise. * gcc.dg/builtin-unreachable-5.c: Likewise. * gcc.dg/builtin-unreachable-6.c: Likewise. * gcc.dg/builtin-unreachable-6a.c: Likewise. * gcc.dg/builtin-unreachable-7.c: Likewise. * gcc.dg/pr78408-2.c: Change fab1 to forwprop1 as that optimization was moved there a while back. * gcc.dg/tree-ssa/pr79691.c: Udpate scanning for 9 constant to return. Signed-off-by: Andrew Pinski <[email protected]>
