https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106332
--- Comment #3 from liftdat at protonmail dot com --- (In reply to Andrew Pinski from comment #1) > The one inside check_offload_target_name (in gcc.cc) will always have at > least one entry in candidates. > > The one inside cmdline_handle_error (in opts-common.cc) could in theory be > called with no elements for candidates but if there was none, the option > itself would have been disabled before hand. > > The two in config/aarch64.cc: > aarch64_print_hint_for_core_or_arch: there will always be at least one > candidate since there is always more than one core/arch defined. > aarch64_print_hint_for_extensions: there is always at least one candidate as > extensions will always be more than one > > > > The few in config/i386.cc: > ix86_parse_stringop_strategy_string: at least one stringop_strategy > ix86_option_override_internal (both of them): at least one processor defined > > > > So the question is how did you find this? This is found by a static analysis tool. I think putting an assertion can help to clarify the requirements for any future clients of this function.