https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83324
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andi Kleen <a...@gcc.gnu.org>: https://gcc.gnu.org/g:b738a63e528db410a1c51fc27db37fe22f0cb397 commit r15-2124-gb738a63e528db410a1c51fc27db37fe22f0cb397 Author: Andi Kleen <a...@linux.intel.com> Date: Wed May 15 19:57:22 2024 -0700 Enable musttail tail conversion even when not optimizing Enable the tailcall optimization for non optimizing builds, but in this case only checks calls that have the musttail attribute set. This makes musttail work without optimization. This is done with a new late musttail pass that is only active when not optimizing. The new pass relies on tree-cfg to discover musttails. This avoids a ~0.8% compiler run time penalty at -O0. gcc/ChangeLog: PR c/83324 * function.h (struct function): Add has_musttail. * lto-streamer-in.cc (input_struct_function_base): Stream has_musttail. * lto-streamer-out.cc (output_struct_function_base): Dito. * passes.def (pass_musttail): Add. * tree-cfg.cc (notice_special_calls): Record has_musttail. (clear_special_calls): Clear has_musttail. * tree-pass.h (make_pass_musttail): Add. * tree-tailcall.cc (find_tail_calls): Handle only_musttail argument. (tree_optimize_tail_calls_1): Pass on only_musttail. (execute_tail_calls): Pass only_musttail as false. (class pass_musttail): Add. (make_pass_musttail): Add.