https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121762
--- Comment #13 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:a8326b0c20383b4f10c8a5a3c8c4887fd54d4335 commit r16-4201-ga8326b0c20383b4f10c8a5a3c8c4887fd54d4335 Author: Andrew Pinski <[email protected]> Date: Tue Sep 23 11:37:35 2025 -0700 fab/forwprop: Move optimize stack restore to forwprop [PR121762] This moves the removal of redundant stack restore from fab to forwprop. There is a possibility of removing some of the redundant stack restores before the last folding but that is for a different patch. Changes since v1: * v2: the additional comment change. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/121762 gcc/ChangeLog: * tree-ssa-ccp.cc (optimize_stack_restore): Move to tree-ssa-forwprop.cc. (pass_fold_builtins::execute): Don't call optimize_stack_restore. * tree-ssa-forwprop.cc (optimize_stack_restore): New function from tree-ssa-ccp.cc. Return bool instead of value, use replace_call_with_value istead of returning integer_zero_node. (simplify_builtin_call): Call optimize_stack_restore. Signed-off-by: Andrew Pinski <[email protected]>
