https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114232
--- Comment #24 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to rguent...@suse.de from comment #22) > I think optimize_function_for_size_p (cfun) isn't always true if > optimize_size is since it looks at the function-specific setting > of that flag, so you'd have to use opt_for_fn (cfun, optimize_size). I think the insn-flags.h macros and actual insn conditions are checked when the corresponding function is current, and at that point opt_for_fn (cfun, optimize_size) should be the same as optimize_size. Even the set_cfun hook first sets the option and then tries to initialize optab and compares it against the global one.