https://gcc.gnu.org/g:1f478b1d25bab8f45309cf43cf274b4d12785456
commit r16-6351-g1f478b1d25bab8f45309cf43cf274b4d12785456 Author: Xi Ruoyao <[email protected]> Date: Thu Dec 18 11:39:38 2025 +0800 LoongArch: relax the check for --with-tune Someone (via a WeChat group) reported that --with-arch=la464 --with-tune=la664 had stopped to work after commiting the LA32 support. While this can be treated as a simple logic error (i.e. we may simply change "loongarch64" in the case statement to an asterisk), IMO we should just relax the check: at runtime the "unreasonable" combinations like "-march=la64v1.0 -mtune=loongarch32" or "-march=la664 -mtune=la464" is allowed (and the second case has been allowed for a long time), and a combination of --with-arch=A --with-tune=T should be allowed if -march=A -mtune=T is allowed at runtime. Also if we consider the fact that --with-tune= and -mtune= only select a set of heruistic parameters, such combinations may be not so unreasonable. gcc/ * config.gcc: Relax the check for LoongArch with_tune. Diff: --- gcc/config.gcc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index ed862ca12f47..6c8545883fd2 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -5334,14 +5334,7 @@ case "${target}" in # Check default with_tune configuration using with_arch. - case ${with_arch} in - la32v1.0 | la32rv1.0) - tune_pattern="loongarch32" - ;; - loongarch64) - tune_pattern="native|generic|loongarch64|la[46]64" - ;; - esac + tune_pattern="native|generic|loongarch64|la[46]64|loongarch32" case ${with_tune} in "") ;; # OK
