https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118339
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Dominic Plunkett <[email protected]>: https://gcc.gnu.org/g:cc602c35ccdeb48d06a9c6788edf8bafe365fb47 commit r17-7029-gcc602c35ccdeb48d06a9c6788edf8bafe365fb47 Author: Dominic P <[email protected]> Date: Mon Nov 30 22:29:10 2026 +0000 aarch64: Fix ICEs on invalid target_version/target_clones strings [PR118339] aarch64_parse_fmv_features had two problems with invalid strings: - An extra argument without '=', as in "sve;default" or "sve;", left the value slice invalid, and stripping it ICEd in array_slice::begin. - Duplicate features were only detected when the caller asked for the feature mask. The target_version and target_clones validation callers do not, so "sve2+sve2" was accepted and the later parse in get_feature_mask_for_version hit its assert. Only strip a valid value, and track the feature mask locally whether or not the caller wants it. Both cases now give the existing "invalid feature modifier" and "duplicate feature modifier" diagnostics. The testcases in PR118339 no longer ICE on trunk, but strings such as "sve2+sve2,default" still did. Assisted-by: Claude Opus 5.5 (Anthropic) Signed-off-by: Dominic P <[email protected]> gcc/ChangeLog: PR target/118339 * config/aarch64/aarch64.cc (aarch64_parse_fmv_features): Always track the feature mask, to detect duplicate features. Do not strip an invalid argument value. gcc/testsuite/ChangeLog: PR target/118339 * gcc.target/aarch64/mv-error13.c: New test. * gcc.target/aarch64/mvc-warning2.c: Likewise. * g++.target/aarch64/mv-error13.C: Likewise. * g++.target/aarch64/mvc-warning2.C: Likewise.
